The system prompt is made once per session (start, compaction, model switch), kept in session_meta and resent byte for byte; it holds no date. What changes mid-session -- the date, a mode the person chose, a plan or memory or instruction file they edited, a personality, MCP instructions that arrived later -- is a <session-note> on the next user message, stored with it. The tool list is fixed for the session: plan_submit is always offered and answers unavailable outside plan mode, the wrap-up keeps the tools and runs no call, a withdrawn tool stays listed and answers its refusal; the first request waits up to mcp_wait_ms for MCP servers. Compaction asks for its summary as the next turn of the same conversation. Cached input tokens are parsed (incl. llama.cpp timings), stored per request and shown in /context. Spec: context.md §7/§10, loop.json context.note (+ plan_ended, plan_own, personal, empty, mcp_wait_ms), modes.json plan.refused, compact.md without the transcript heading. Conformance area prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
36 files changed
+1533
-169
No files matched your search
+13
-6
@@ -360,14 +360,21 @@ test("the context reaches the prompt: the instance's instructions, its personali
|
||||
// names nothing to the model — nothing unfilled reaches it either.
|
||||
expect(system()).not.toContain("Manuals")
|
||||
expect(system()).not.toContain("{{")
|
||||
// A later prompt replaces the context: personalization back to the device's, nothing from the instance.
|
||||
// A later prompt replaces the context: personalization back to the device's, nothing from the
|
||||
// instance. The system prompt stays as it was made (harness context.md §10); the change goes as a
|
||||
// note on that prompt's message.
|
||||
const first = system()
|
||||
await c.request("session/prompt", { sessionId: s.sessionId, prompt: [{ type: "text", text: "again" }], _meta: { lembas: { turnId: "T2", system_prompt: "", personalization: null, prototypes: { offered: false, sources: "" } } } })
|
||||
expect(system()).not.toContain("Instructions from example")
|
||||
expect(system()).toContain("local words")
|
||||
expect(system()).not.toContain("prototype-chat")
|
||||
// A prompt that says only its turn id changes nothing.
|
||||
expect(system()).toBe(first)
|
||||
const said = () => fake!.requests.at(-1)!.messages.at(-1).content as string
|
||||
expect(said()).toStartWith("again\n<session-note>\n")
|
||||
expect(said()).toContain("the person's own instructions changed; it now reads:\nlocal words")
|
||||
expect(said()).toContain("Instructions from example changed; it now reads:\n(none)")
|
||||
expect(said()).toContain("The person chose a different personality:\nBe brief.")
|
||||
// A prompt that says only its turn id changes nothing, and so says nothing.
|
||||
await c.request("session/prompt", { sessionId: s.sessionId, prompt: [{ type: "text", text: "more" }], _meta: { lembas: { turnId: "T3" } } })
|
||||
expect(system()).toContain("local words")
|
||||
expect(system()).toBe(first)
|
||||
expect(said()).toBe("more")
|
||||
})
|
||||
|
||||
test("the plan is sent after a session is opened from the store, and cleared with plan: null", async () => {
|
||||
|
||||
Reference in new issue
Block a user