Skip to content

Pulse Siri endpoint never resumes the conversation: resume is passed beside options, which query() ignores #2795

Closed

Description

@gjaworski86

Version

LifeOS 8.761.0 · attestation: 30 system file(s) differ from danielmiessler/LifeOS@v8.761.0:

  • hooks/SatisfactionCapture.hook.ts
  • hooks/README.md
  • skills/CreateCLI/SKILL.md
  • skills/CreateCLI/Intents/CreateCli.md
  • skills/Prompting/SKILL.md
  • skills/LifeOSHooks/hooks/lib/build.ts
  • skills/Herdr/Intents/Configure.md
  • skills/LifeOS/SKILL.md
  • skills/LifeOS/Intents/Setup.md
  • skills/Fabric/SKILL.md
  • LIFEOS/TOOLS/VideoMeaning/README.md
  • LIFEOS/TOOLS/models.ts
  • LIFEOS/TOOLS/model-pricing.json
  • LIFEOS/DOCUMENTATION/Tools/Tools.md
  • LIFEOS/DOCUMENTATION/Memory/MemorySystem.md
  • LIFEOS/DOCUMENTATION/Location/LocationSystem.md
  • LIFEOS/DOCUMENTATION/Pulse/TerminalTabs.md
  • LIFEOS/DOCUMENTATION/Pulse/PulseSystem.md
  • LIFEOS/DOCUMENTATION/Workflows/WorkflowsSystem.md
  • LIFEOS/DOCUMENTATION/LifeosSystemArchitecture.md
  • LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md
  • LIFEOS/DOCUMENTATION/Algorithm/AscentStates.md
  • LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md
  • LIFEOS/DOCUMENTATION/Hooks/HookSystem.md
  • LIFEOS/DOCUMENTATION/Work/WorkSystem.md
  • LIFEOS/DOCUMENTATION/Assay/AssaySystem.md
  • LIFEOS/DOCUMENTATION/Services/BackgroundServices.md
  • LIFEOS/DOCUMENTATION/Router/RouterSystem.md
  • LIFEOS/ALGORITHM/AlgorithmReference.md
  • LIFEOS/ERRATA/fixtures/LabelBrief.md

What is broken

The Siri endpoint never continues a conversation. runTurn() keeps the SDK session id from the first turn and, on the next turn inside the 60-minute window, sets it as queryOpts.resume, a sibling of options. The Agent SDK's query() destructures only { prompt, options } (sdk.mjs function query({ prompt, options }); the typed signature is query(_params: { prompt; options?: Options }), and resume is an Options field), so the id is dropped and every Siri turn starts a fresh session. The as never cast on the call hides the type error. Related hardening in the same object: sdkOptions sets no permissionMode. The installed SDK still defaults an omitted mode to "default", so canUseTool runs today, but with the shipped defaultMode: "auto" this remote, voice-only channel's tool gate then depends on an SDK default rather than on the code.
Related, not a duplicate: #1143 (closed) was about the since-removed Telegram module, which set sdkOptions.resume inside options and resumed correctly; siri.ts is the remaining Pulse channel that resumes an SDK session, and it puts the id beside options.

Where (file:line)

LIFEOS/PULSE/modules/siri.ts:135-139

Repro on a clean tree

1. Run the captured probe command from the config root. The files it exercises (`LIFEOS/PULSE/modules/siri.ts`, `LIFEOS/PULSE/lib/*`, `hooks/lib/identity.ts`) are untouched on this install; `siri.ts` is byte-identical to main@f6ab5e02 apart from the installer's DA-name substitution in two comment lines. The probe writes a bun test to a temp dir that imports the real `siri.ts`, replaces only the SDK's `query` (recording its argument), the per-turn context builder, the MCP allowlist and the identity reader (so no user data is read), then sends two authorized POSTs to `/api/siri/turn`. The report redactor masks one probe line: it assigns the dummy `TEST_BEARER` from the line above to `process.env.SIRI_API_KEY`.
2. Expected: the second `query()` call carries `options.resume === "sess-1"` (the session id the first turn's init message returned).
3. Actual: `options.resume` is `undefined`; the id sits at the top level of the argument, where `query()` never reads it.

Negative control

Probe: d=$(mktemp -d) && cat > "$d/siri-resume.test.ts" <<'EOF' import { test, expect, mock } from "bun:test"; import { join } from "node:path"; import { homedir } from "node:os"; const pulse = join(process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), ".claude"), "LIFEOS", "PULSE"); const calls: any[] = []; mock.module(Bun.resolveSync("@anthropic-ai/claude-agent-sdk", join(pulse, "modules")), () => ({ query: (args: any) => { calls.push(args); return (async function* () { yield { type: "system", subtype: "init", session_id: "sess-1" }; yield { type: "assistant", message: { content: [{ type: "text", text: "ok" }] } }; })(); }, })); mock.module(join(pulse, "lib", "lifeos-context.ts"), () => ({ buildLifeosContextBlock: async () => "" })); mock.module(join(pulse, "lib", "mcp-allowlist.ts"), () => ({ loadRemoteMcpServers: () => ({}), mcpStatusPromptLine: () => "" })); mock.module(join(pulse, "..", "..", "hooks", "lib", "identity.ts"), () => ({ getDAName: () => "DA", getPrincipalName: () => "Principal" })); const TEST_BEARER = "probe"; // dummy value for the probe only process.env.SIRI_API_KEY = <redacted> const { handleSiriRequest } = await import(join(pulse, "modules", "siri.ts")); const turn = (text: string) => handleSiriRequest(new Request("http://localhost/api/siri/turn", { method: "POST", headers: { authorization: Bearer ${TEST_BEARER}, "content-type": "application/json" }, body: JSON.stringify({ text }), }), "/api/siri/turn"); test("second Siri turn passes the first session id to query() as options.resume", async () => { await turn("first"); await turn("second"); expect(calls.length).toBe(2); expect(calls[1].options?.resume).toBe("sess-1"); // query({ prompt, options }) only reads it here }); EOF bun test "$d/siri-resume.test.ts" · exit 1 · captured 2026-11-13T11:09:01.642Z

Red looks like: (fail) second Siri turn passes the first session id to query() as options.resume

bun test v1.4.4 (38afee6c8)
{"ts":"2026-11-13T11:09:01.640Z","module":"siri","level":"info","msg":"siri turn served","ms":0,"inChars":5,"outChars":2}
{"ts":"2026-11-13T11:09:01.640Z","module":"siri","level":"info","msg":"siri turn served","ms":0,"inChars":6,"outChars":2}

--- stderr ---

../../../private/var/folders/5h/hl0y9ht11z16rb3y13007sbc0000gn/T/tmp.GLDKPWLfd0/siri-resume.test.ts:
19 |   method: "POST", headers: { authorization: `Bearer ${TEST_BEARER}`, "content-type": "application/json" }, body: JSON.stringify({ text }),
20 | }), "/api/siri/turn");
21 | test("second Siri turn passes the first session id to query() as options.resume", async () => {
22 |   await turn("first"); await turn("second");
23 |   expect(calls.length).toBe(2);
24 |   expect(calls[1].options?.resume).toBe("sess-1"); // query({ prompt, options }) only reads it here
                                        ^
error: expect(received).toBe(expected)

Expected: "sess-1"
Received: undefined

      at <anonymous> (/private/var/folders/5h/hl0y9ht11z16rb3y13007sbc0000gn/T/tmp.GLDKPWLfd0/siri-resume.test.ts:24:36)
(fail) second Siri turn passes the first session id to query() as options.resume [3.38ms]

 0 pass
 1 fail
 2 expect() calls
Ran 1 test across 1 file. [9.00ms]

Suggested fix

Put resume inside the options object and drop the as never cast: import type Options, declare const sdkOptions: Options = { cwd: CWD, ...(resumeFromSdk ? { resume: resumeFromSdk } : {}), permissionMode: "default", ... }, delete queryOpts, and call query({ prompt: text, options: sdkOptions }). Pinning permissionMode: "default" keeps every tool request routed through canUseTool whatever the SDK's default for an omitted mode becomes. With exactly that change applied to a copy of siri.ts, the captured probe passes (1 pass, 0 fail).

Environment

  • OS: macOS 27.2 (arm64)
  • Harness: claude-code
  • bun: 1.4.4 · git: 2.54.0
  • Doctor broken: none

Activity

  1. danielmiessler commented on Nov 18, 2026

    @danielmiessler
    Owner

    Note

    🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

    Thanks @gjaworski86, you found that the Siri endpoint never resumed a conversation because resume sat beside the options, where query() ignores it. It now goes inside the options, and the permission mode is unchanged. Thanks also to @isihussain for PR #2800, which we used as a reference.

    This fix lands in the next LifeOS release, so I'm closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions