feat: add optional systemPrompt field to session/new#1494
Conversation
Reference implementation of the Client-Provided System Prompt RFD. Adds an optional `systemPrompt: Option<String>` to NewSessionRequest, letting clients deliver system-level instructions to an agent at session creation. Semantics are additive: agents incorporate the content alongside their own built-in instructions rather than replacing them. The field is optional and backward compatible — agents that ignore it behave unchanged. Regenerates the committed JSON Schema and protocol docs so the published artifacts match the Rust types. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
The schema docs already document the field, but the narrative session-setup pages still listed only cwd and mcpServers.
|
Hope this work can progress quickly. |
|
Closing in favor of the ACP+ approach. The goose-side implementation (aaif-goose/goose#9971) is being updated to read |
|
Hey all yeah I think the _meta is the right approach for now. I'm sorry, we are focusing a lot of bandwidth on the v2 spec and we already had a lot of drafts that were sitting there without much progress so I have held off from adopting more until we got through the backlog some more. I think we're almost to the point where we can add some more though, and this feature certainly makes sense! Along wiht some other things in session/new |
Adds an optional
systemPrompt: Option<String>field toNewSessionRequest(session/new), giving clients a standard way to deliver system-level instructions to an agent at session creation.The semantics are additive: agents incorporate the content alongside their own built-in instructions rather than replacing them, and an agent that ignores the field behaves exactly as before. The field is optional and backward compatible. Per the field's contract, an agent that cannot incorporate the system prompt MUST return a JSON-RPC error and MUST NOT create the session.
This is the reference implementation of the RFD in #1237.
Changes
src/agent.rs—system_prompt: Option<String>onNewSessionRequest, asystem_prompt(...)builder, and round-trip + absent-omission serialization tests.schema/schema.json,schema/schema.unstable.json,docs/protocol/schema.mdx,docs/protocol/draft/schema.mdx— regenerated so the published artifacts match the Rust types.docs/protocol/session-setup.mdx,docs/protocol/draft/session-setup.mdx— addedsystemPromptto the parameter bullet list and JSON-RPC example in the narrative docs.The field serializes as
systemPrompton the wire and is omitted entirely when absent.Related: #1237 (the RFD this implements) and the consuming goose change aaif-goose/goose#9971.