feat: unify execution and add workspace file imports
Remove Ask/Execute modes and general product tool approvals so requests use the selected runtime, enabled capabilities, and execution account permissions. Migrate retired application metadata while preserving user content. Retire the Results page while retaining conversation images and stored artifacts. Add local and remote workspace file imports, timestamps and sorting, improve image discovery and saving, and refine workspace navigation and supervision responsiveness. Include the accompanying web-search changes, tests, probes, and product documentation. Remote imports require an updated Agent. Existing artifacts are not automatically copied into project directories. Validation evidence and outstanding failures remain documented in feature progress files; no full test suite or real-model calls were rerun for this commit. Release note: Run requests without switching work modes, import files into a selected local or remote workspace folder, sort workspace files by date, and keep using conversation images after removal of the Results page.
This commit is contained in:
@@ -50,7 +50,7 @@ export class MainImageToolSession {
|
||||
try {
|
||||
this.wait.signal.throwIfAborted()
|
||||
if ('name' in call && call.name === 'save_image_read') {
|
||||
if (!this.binding?.readForSave || this.binding.context.workMode !== 'execute') throw new Error('Saving images is unavailable in Ask mode')
|
||||
if (!this.binding?.readForSave) throw new Error('Saving images is unavailable')
|
||||
const { artifactId, mimeType, offset } = call.input
|
||||
const cacheKey = `${artifactId}:${mimeType}`
|
||||
let bytes = this.saveCache?.key === cacheKey ? this.saveCache.bytes : undefined
|
||||
@@ -71,7 +71,7 @@ export class MainImageToolSession {
|
||||
: await this.storyGraph.call(call.name, call.input, this.wait.signal)
|
||||
reply = remoteImageToolReplySchema.parse({ callId: call.callId, storyGraphResult })
|
||||
} else {
|
||||
if (!this.binding || this.binding.context.workMode !== 'execute') throw new Error('Image tools are unavailable in Ask mode')
|
||||
if (!this.binding) throw new Error('Image tools are unavailable')
|
||||
const result = await this.binding.call(call.input, call.callId, this.wait.signal)
|
||||
reply = remoteImageToolReplySchema.parse({ callId: call.callId, result })
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ describe('createManagedRemoteAcpRuntime', () => {
|
||||
fixture.options.agentServices.connectionManager.acquire
|
||||
).toHaveBeenCalledWith('host-1', expect.objectContaining({
|
||||
requiredCapabilities: [
|
||||
{ name: 'runtime/acp', exactVersion: 5, critical: true }
|
||||
{ name: 'runtime/acp', exactVersion: 6, critical: true }
|
||||
]
|
||||
}))
|
||||
|
||||
@@ -567,7 +567,7 @@ function capabilities() {
|
||||
return {
|
||||
generation: 7,
|
||||
capabilities: [
|
||||
{ name: 'runtime/acp', version: 5, critical: true }
|
||||
{ name: 'runtime/acp', version: 6, critical: true }
|
||||
],
|
||||
runtimes: [
|
||||
{
|
||||
@@ -587,7 +587,6 @@ function request(requestId: string) {
|
||||
requestId,
|
||||
conversationId: 'conversation-1',
|
||||
prompt: 'hello',
|
||||
workMode: 'ask' as const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ function advertisedCapabilities(): DaemonCapabilities {
|
||||
generation: 2,
|
||||
capabilities: [
|
||||
{ name: 'workspace/read', version: 1, critical: true },
|
||||
{ name: 'runtime/acp', version: 5, critical: true },
|
||||
{ name: 'runtime/acp', version: 6, critical: true },
|
||||
{
|
||||
name: 'runtime/model-bridge',
|
||||
version: 1,
|
||||
@@ -268,7 +268,7 @@ describe('ManagedRemoteProjectRuntimeValidator', () => {
|
||||
...advertisedCapabilities(),
|
||||
capabilities: [
|
||||
{ name: 'workspace/read', version: 1, critical: true },
|
||||
{ name: 'runtime/acp', version: 5, critical: true }
|
||||
{ name: 'runtime/acp', version: 6, critical: true }
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -278,7 +278,7 @@ describe('ManagedRemoteProjectRuntimeValidator', () => {
|
||||
...advertisedCapabilities(),
|
||||
capabilities: [
|
||||
{ name: 'workspace/read', version: 1, critical: true },
|
||||
{ name: 'runtime/acp', version: 5, critical: true },
|
||||
{ name: 'runtime/acp', version: 6, critical: true },
|
||||
{
|
||||
name: 'runtime/model-bridge',
|
||||
version: 3,
|
||||
@@ -294,7 +294,7 @@ describe('ManagedRemoteProjectRuntimeValidator', () => {
|
||||
capabilities: [
|
||||
{
|
||||
name: 'runtime/acp',
|
||||
version: 5,
|
||||
version: 6,
|
||||
critical: false
|
||||
}
|
||||
]
|
||||
|
||||
@@ -321,7 +321,7 @@ function validCapabilities(): DaemonCapabilities {
|
||||
return {
|
||||
generation: 11,
|
||||
capabilities: [
|
||||
{ name: 'runtime/acp', version: 5, critical: true }
|
||||
{ name: 'runtime/acp', version: 6, critical: true }
|
||||
],
|
||||
runtimes: [
|
||||
{
|
||||
@@ -490,15 +490,15 @@ async function openChannel(fixture = connectionFixture()) {
|
||||
}
|
||||
|
||||
describe('ProtocolRemoteRuntimeChannel', () => {
|
||||
it('refreshes image binding descriptions per prompt, hides Ask, and closes failed preparations', async () => {
|
||||
it('refreshes image binding descriptions per prompt and closes failed preparations', async () => {
|
||||
const fixture = await openChannel()
|
||||
const describe = vi.fn(async () => 'First image catalog')
|
||||
const binding: ImageToolBinding = {
|
||||
context: { conversationId: 'conversation', messageId: 'message', requestId: 'operation-1', workMode: 'execute' },
|
||||
context: { conversationId: 'conversation', messageId: 'message', requestId: 'operation-1' },
|
||||
describe, call: vi.fn()
|
||||
}
|
||||
const prepare = (requestId: string, workMode: 'ask' | 'execute' = 'execute') => ({
|
||||
bindingId: 'binding-1', operationId: requestId, requestId, workMode,
|
||||
const prepare = (requestId: string) => ({
|
||||
bindingId: 'binding-1', operationId: requestId, requestId,
|
||||
controllerId: 'controller-1', controllerGeneration: 1, connectionGeneration: fixture.channel.generation,
|
||||
channelEpoch: fixture.channel.channelEpoch, hostId: 'host-1', hostRevision: 1, hostKeyGeneration: 1,
|
||||
workspaceIdentity: 'workspace-1', agentInstallationId: 'agent-1', runtimeId: 'opencode',
|
||||
@@ -509,7 +509,7 @@ describe('ProtocolRemoteRuntimeChannel', () => {
|
||||
if (method !== 'runtime/preparePrompt') return defaultResponse(method, params)
|
||||
const input = params as ReturnType<typeof prepare> & { imageTool?: { description: string } }
|
||||
return { bindingId: input.bindingId, operationId: input.operationId, requestId: input.requestId,
|
||||
workMode: input.workMode, deadlineAt: input.deadlineAt, acceptedAt: new Date().toISOString(),
|
||||
deadlineAt: input.deadlineAt, acceptedAt: new Date().toISOString(),
|
||||
...(input.imageTool ? { imageToolUrl: 'http://127.0.0.1:1234/image' } : {}) }
|
||||
}
|
||||
try {
|
||||
@@ -521,21 +521,27 @@ describe('ProtocolRemoteRuntimeChannel', () => {
|
||||
await fixture.channel.preparePrompt(prepare('operation-2'), binding, wait.signal)
|
||||
expect(fixture.client.blobBinaries[0]!.closed).toBe(true)
|
||||
expect(fixture.client.requests.at(-1)!.params).toMatchObject({ imageTool: { description: 'Refreshed image catalog' } })
|
||||
await fixture.channel.preparePrompt(prepare('operation-3', 'ask'), binding, wait.signal)
|
||||
await fixture.channel.preparePrompt(prepare('operation-3'), undefined, wait.signal)
|
||||
expect(describe).toHaveBeenCalledTimes(2)
|
||||
expect(fixture.client.blobBinaries[1]!.closed).toBe(true)
|
||||
expect(fixture.client.requests.at(-1)!.params).not.toHaveProperty('imageTool', expect.anything())
|
||||
const graph = { available: vi.fn(async () => true), call: vi.fn() }
|
||||
await fixture.channel.preparePrompt(prepare('graph-ask', 'ask'), undefined, wait.signal, graph)
|
||||
await fixture.channel.preparePrompt(prepare('graph'), undefined, wait.signal, graph)
|
||||
expect(fixture.client.requests.at(-1)!.params).toMatchObject({ imageTool: { storyGraph: true } })
|
||||
expect((fixture.client.requests.at(-1)!.params as { imageTool: object }).imageTool).not.toHaveProperty('description')
|
||||
graph.available.mockResolvedValue(false)
|
||||
await fixture.channel.preparePrompt(prepare('graph-disabled', 'ask'), undefined, wait.signal, graph)
|
||||
await fixture.channel.preparePrompt(prepare('graph-disabled'), undefined, wait.signal, graph)
|
||||
expect(fixture.client.blobBinaries[2]!.closed).toBe(true)
|
||||
expect(fixture.client.requests.at(-1)!.params).not.toHaveProperty('imageTool', expect.anything())
|
||||
const saveOnly: ImageToolBinding = { ...binding, describe: async () => undefined,
|
||||
describeSave: async () => 'Conversation image IDs', readForSave: vi.fn() }
|
||||
await fixture.channel.preparePrompt(prepare('save-only'), saveOnly, wait.signal)
|
||||
expect(fixture.client.requests.at(-1)!.params).toMatchObject({ imageTool: { saveDescription: 'Conversation image IDs' } })
|
||||
expect((fixture.client.requests.at(-1)!.params as { imageTool: object }).imageTool).not.toHaveProperty('description')
|
||||
fixture.client.responder = () => { throw new Error('preparation response lost') }
|
||||
await expect(fixture.channel.preparePrompt(prepare('operation-4'), binding, wait.signal)).rejects.toThrow()
|
||||
expect(fixture.client.blobBinaries[3]!.closed).toBe(true)
|
||||
expect(fixture.client.blobBinaries[4]!.closed).toBe(true)
|
||||
} finally { await fixture.channel.close() }
|
||||
})
|
||||
it('sends question replies on the authenticated control channel and rejects foreign bindings', async () => {
|
||||
@@ -783,7 +789,6 @@ describe('ProtocolRemoteRuntimeChannel', () => {
|
||||
bindingId: 'binding-1',
|
||||
operationId: 'operation-1',
|
||||
requestId: 'operation-1',
|
||||
workMode: 'execute',
|
||||
controllerId: 'controller-1',
|
||||
controllerGeneration: 1,
|
||||
connectionGeneration: fixture.channel.generation,
|
||||
@@ -1106,16 +1111,16 @@ describe('ProtocolRemoteRuntimeChannel', () => {
|
||||
mutate: (capabilities: DaemonCapabilities): DaemonCapabilities => ({
|
||||
...capabilities,
|
||||
capabilities: [
|
||||
{ name: 'runtime/acp', version: 3, critical: false }
|
||||
{ name: 'runtime/acp', version: 6, critical: false }
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
label: 'non-exact capability version',
|
||||
label: 'legacy mode-bearing capability version',
|
||||
mutate: (capabilities: DaemonCapabilities): DaemonCapabilities => ({
|
||||
...capabilities,
|
||||
capabilities: [
|
||||
{ name: 'runtime/acp', version: 1, critical: true }
|
||||
{ name: 'runtime/acp', version: 5, critical: true }
|
||||
]
|
||||
})
|
||||
},
|
||||
|
||||
@@ -595,9 +595,9 @@ export class ProtocolRemoteRuntimeChannel
|
||||
> {
|
||||
this.#imageTool?.close()
|
||||
this.#imageTool = undefined
|
||||
const description = preparation.workMode === 'execute' ? await imageToolBinding?.describe() : undefined
|
||||
const description = await imageToolBinding?.describe()
|
||||
const storyGraph = await storyGraphBinding?.available()
|
||||
const saveDescription = preparation.workMode === 'execute' && imageToolBinding?.readForSave
|
||||
const saveDescription = imageToolBinding?.readForSave
|
||||
? await imageToolBinding.describeSave?.() : undefined
|
||||
waitSignal?.throwIfAborted()
|
||||
let imageTool: z.infer<typeof remotePromptOperationPreparationSchema>['imageTool']
|
||||
|
||||
@@ -46,7 +46,6 @@ class Owner extends EventEmitter implements RemoteProjectSaveOwner {
|
||||
const draft = {
|
||||
name: 'Remote',
|
||||
description: 'Validated remotely',
|
||||
defaultWorkMode: 'ask' as const,
|
||||
runtimeSelection: { provider: 'opencode' as const },
|
||||
hostId,
|
||||
remoteRootPath: root
|
||||
@@ -70,7 +69,6 @@ function project(
|
||||
name: draft.name,
|
||||
description: draft.description,
|
||||
rootPath: root,
|
||||
defaultWorkMode: draft.defaultWorkMode,
|
||||
runtimeSelection: draft.runtimeSelection,
|
||||
kind: 'user',
|
||||
executionSpace: {
|
||||
|
||||
@@ -368,7 +368,6 @@ export class RemoteProjectSaveService {
|
||||
name: request.draft.name,
|
||||
description: request.draft.description,
|
||||
rootPath: workspace.canonicalDisplayPath,
|
||||
defaultWorkMode: request.draft.defaultWorkMode,
|
||||
runtimeSelection
|
||||
},
|
||||
executionSpace: {
|
||||
|
||||
Reference in New Issue
Block a user