Skip to content

feat(rap-protocol): let RAP servers inject system-prompt fragments via their manifest - #154

Open
akainth015 wants to merge 1 commit into
mainfrom
pr/rap-system-prompt
Open

akainth015 wants to merge 1 commit into
mainfrom
pr/rap-system-prompt

Conversation

@akainth015

@akainth015 akainth015 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Adds an optional systemPrompt field to the RAP toolset manifest (/.well-known/rap-toolset), analogous to MCP's instructions.

  • When building a session's toolset, the daemon appends each booted server's fragment to the session's system prompt under a ## Instructions from the `<server>` tool server header, in config order; all threads of the session see it.
  • A server that is down contributes neither tools nor a fragment (existing warning path).
  • Backward compatible: the field is omitted when None, and older runtimes ignore it.

Base of the steering stack (#155 builds on it).

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Deploying infinity with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4220137
Status: ✅  Deploy successful!
Preview URL: https://4f8c710d.infinity-dc7.pages.dev
Branch Preview URL: https://pr-rap-system-prompt.infinity-dc7.pages.dev

View logs

@akainth015
akainth015 changed the base branch from pr/steering-clone-order to pr/steering-suggest October 19, 2026 18:16
@akainth015
akainth015 force-pushed the pr/rap-system-prompt branch from 52cda19 to c4a0051 Compare October 19, 2026 18:16
@akainth015
akainth015 force-pushed the pr/rap-system-prompt branch from c4a0051 to a77efb3 Compare October 20, 2026 00:04
@akainth015
akainth015 marked this pull request as draft October 20, 2026 02:52
@akainth015
akainth015 force-pushed the pr/rap-system-prompt branch from a77efb3 to bf8bb75 Compare October 20, 2026 17:42
…a their manifest

* `ToolsetManifest` gains an optional `systemPrompt` field (omitted when
  `None`; servers and runtimes that predate it are unaffected).
* When building a session's toolset, the daemon appends each booted
  server's fragment to the session's `extra_system_prompt` under a
  "## Instructions from the `<server>` tool server" header, in config
  order, so every thread of the session sees it. A server that is down
  contributes neither tools nor a fragment.
@akainth015
akainth015 force-pushed the pr/rap-system-prompt branch from bf8bb75 to 4220137 Compare November 4, 2026 23:49
@akainth015
akainth015 changed the base branch from pr/steering-suggest to main November 4, 2026 23:49
@akainth015
akainth015 marked this pull request as ready for review November 6, 2026 23:11
@akainth015
akainth015 requested a review from a team November 6, 2026 23:11
@shadaj

shadaj commented Nov 6, 2026

Copy link
Copy Markdown
Member

For MCP servers, which lazily load / connect, I guess we will want to include instructions when you load the list of tools...

Which makes me wonder if we should move some text from the tool descriptions in the MCP proxy into a systemPrompt?

let mut tools: Vec<Rc<dyn Tool<ChannelSender>>> = Vec::new();
let mut tool_count = 0usize;
let mut server_prompts = String::new();
for server in &servers {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this deterministic?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants