The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): /save refuses the legacy host fallback when redact, a format or a name was asked
Tekniumfbcd4fcf5284
diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.test.tsx b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.test.tsxindex b5649c157dc..342e9a21978 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.test.tsx@@ -278,6 +278,32 @@ describe('/save writes on the Electron side', () => {expect(renderedText(handle)).toMatch(/not saved/i)})+ it('falls back to the legacy host save only for a plain /save, and says where it wrote', async () => {+ const requestGateway = gateway(method => {+ if (method === 'session.export') {+ throw Object.assign(new Error('Method not found'), { code: -32601 })+ }++ if (method === 'session.save') {+ return { file: '/gateway/saved/raw.json' }+ }+ })++ const handle = await mount(requestGateway)++ await handle.submitText('/save html report.html redact')+ await handle.submitText('/save json redact')+ await handle.submitText('/save md')+ await handle.submitText('/save json mine.json')+ expect(callsOf(requestGateway, 'session.save')).toEqual([])+ expect(renderedText(handle)).not.toContain('/gateway/saved/raw.json')+ expect(renderedText(handle)).toMatch(/not saved/i)++ await handle.submitText('/save')+ expect(callsOf(requestGateway, 'session.save')).toEqual([{ session_id: RUNTIME_SESSION_ID }])+ expect(renderedText(handle)).toContain('Saved on the gateway host: /gateway/saved/raw.json')+ })+it('rejects an unknown format without a gateway call', async () => {const requestGateway = gateway(() => undefined)const handle = await mount(requestGateway)diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.tsindex 29dd5a9f3ce..ab520b2283d 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.ts+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/slash-desktop-commands.ts@@ -361,7 +361,14 @@ export function desktopReadCommandHandlers<C extends { arg: string }>(env: Desktreturn out.render(errorText(err))}- // An older gateway without session.export: its session.save writes JSON on the gateway host.+ // An older gateway without session.export: its session.save writes default-named, unredacted+ // JSON on the gateway host, so only a plain /save may fall back to it.+ if (request.redact || request.format !== 'json' || request.filename) {+ return out.render(+ 'Not saved: this gateway cannot export a redacted, named or non-JSON copy. Update the gateway, or run /save with no options to write raw JSON on the gateway host.'+ )+ }+try {const saved = await requestGateway<{ file?: string }>('session.save', { session_id: out.sessionId })