[feat] Stop evicting warm sessions when an integration is added - #6368
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📘 Docs preview
This comment updates in place on every push. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adding a second integration to an agent evicted its warm session twice over: the integration names were composed into the prompt strings (appendSystemPrompt for Pi, agentsMd for the file-based harnesses) and into the search_tools tool description, and both surfaces are part of the session fingerprint. A one-word list change cost a full sandbox rebuild, fresh Daytona Secrets, and the substitution race of #6362. Now the guidance rides the wire as gatewayGuidance {text, carrier}: - the SDK adapters keep the carrier choice but stop splicing; the prompt strings leave the adapter purely authored; - the runner splices guidance-first at environment build (buildRunPlan), so the text refreshes exactly when a session is built and never evicts one: configFingerprint and the desired-state facets exclude the field by design, with the reason documented at both sites; - the wording presents the names as examples ('For instance, some of the integrations you have: ... Others may exist, and this list can go stale — search_tools is the source of truth'), so a list that goes stale mid-session stays honest; - the derived search_tools/run_tool descriptions drop the names sentence and are now byte-identical for any integration set, so only the FIRST connection (which genuinely adds the two tools) changes session config. Golden run_request.gateway_connection.json pins the new field; the connection-free payloads are byte-identical to before. Claude-Session: https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt
fa9b103 to
2c96b8e
Compare
b1503f1 to
3c21ca2
Compare
Context
Adding a second integration to an agent evicted its warm session, twice over. The integration names were written into the prompt guidance ("Configured integrations: github, slack.") and into the
search_toolstool description, and both surfaces are hashed into the session fingerprint. So a one-word list change cost a full sandbox rebuild, fresh Daytona Secrets, and a pass through the substitution race of #6362. Editing an integration's tool permissions was already fine:gatewayPolicysits outside the fingerprint.Changes
The guidance becomes its own wire field, and the names become examples.
Before: the SDK adapter spliced the guidance into
appendSystemPrompt(Pi) oragentsMd(Claude, Codex), and the runner hashed the result.After: the wire carries
gatewayGuidance: {text, carrier}. The adapters keep the carrier choice but stop splicing, so the prompt strings leave the SDK purely authored. The runner splices guidance-first when it builds an environment (buildRunPlan), andconfigFingerprintplus the desired-state facets exclude the field by design, with the reason documented at both sites. The text refreshes exactly when a session is built, and never evicts one.The wording changes with it: "For instance, some of the integrations you have: github, slack. Others may exist, and this list can go stale —
search_toolsis the source of truth." A list that goes stale mid-session is now honest.The derived
search_tools/run_tooldescriptions drop their names sentence and are byte-identical for any integration set. So only the first connection, which genuinely adds the two tools, changes session config at all.Tests
run_request.gateway_connection.jsonpins the new field. Connection-free payloads are byte-identical to before.gatewayGuidancehash equal.What to QA
search_toolsimmediately; its prompt still names only the first until the next cold start.Stacked on #6367.
https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt