feat: Wire agent system_prompt into guest runtime (Phase 1)#24
Open
TyreeZhao wants to merge 2 commits into
Open
feat: Wire agent system_prompt into guest runtime (Phase 1)#24TyreeZhao wants to merge 2 commits into
TyreeZhao wants to merge 2 commits into
Conversation
AgentDefinition.system_prompt was persisted and editable in the UI but never reached Codex, Claude, or Gemini. Resolve identity at run time, compose it with MPI into provider system instructions, and cover loader/managed project runs. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AgentDefinition.system_promptat run time on the Go host and pass it to the guest via--system-prompt-file, with a fallback retry for older guest runtimes that do not recognize the flag.systemContextinagent-compose-runtime-js, injected into Codexdeveloper_instructions, ClaudesystemPrompt.append, and Gemini prompt text as an interim prepend until a native system channel exists.Motivation
system_promptwas already persisted, exposed in API/Proto, and editable in the Agents UI, but the execution path never read it. Only the MPI catalog reached provider system/developer instruction channels, so configured agent personas had no effect.Test plan
Automated
go test ./pkg/agentcompose -run 'SystemPrompt|AgentSystem' -count=1go test ./pkg/agentcompose -count=1npm test -- --runinruntime/javascriptManual
system_prompt: "Reply only in Chinese"obeys after Codex/Claude chat runsystem_promptskipssystem-prompts/and agent runs normally (simplified regression; no OctoBus/capsets in local env)system_promptManual test notes
go run ./cmd/agent-compose daemonwith data under~/.local/share/agent-compose/.system_promptregression confirmed by filesystem check:state/agents/prompts/present,system-prompts/absent.