fix: deliver generated system prompt files#2273
Conversation
…-2272-prompts # Conflicts: # backend/internal/session_manager/manager.go # backend/internal/session_manager/manager_test.go
harshitsinghbhandari
left a comment
There was a problem hiding this comment.
Core fix is real and lands correctly: main never populated LaunchConfig.SystemPromptFile, so file-only adapters (aider) got no standing instructions, and --issue-only spawns had an empty task prompt. Verified both against main; ran the 5 touched Go packages at head: 388 pass.
Blocking:
- Confidentiality guard silently removed.
systemPromptGuardis deleted and tests assert its absence, butdocs/agent/README.mdadded in this same PR says the system prompt includes "the confidentiality guard". Code and docs contradict; the removal itself is unexplained. Restore the guard or justify + fix the docs. - PR body is stale and hides scope. It says
agentRules/agentRulesFile/orchestratorRulesare follow-ups, but the diff implements them. It never mentions thereactions.gonudge rework,provider.goThreadID/URL, or theshell-env.tsTERM change.
Suggest:
- Drop
agentRulesFile. Harnesses that read repo rules files already pick up AGENTS.md/CLAUDE.md; injecting a repo file again duplicates context. Keep inlineagentRules+orchestratorRules. This also deletesprojectRelativeFile(near-verbatim copy ofdomain.validateRepoRelative) and the new hard-fail on spawn/restore when the file is missing. - Drop
SpawnConfig.IssueContext. No producer anywhere; the issue-context branches ofbuildTaskPromptare dead code. Ship it with the tracker-fetch follow-up. - Prompt files leak.
prompts/<session-id>/is never removed on kill/delete or failed spawn (spawn rollback removes the DB row, not the file). AlsoRestorenow hard-fails if the data dir is unwritable where inline would have worked. - Nudge chattiness. Review-comment signature now includes body/line/URL, so any edit or line re-anchor re-sends the full digest (old design kept sig = IDs on purpose). Cancelled checks now nudge as CI failures, so auto-cancelled superseded runs ping the worker.
escapeMarkdownCodeFenceClosersinserts invisible U+200B into log text agents will copy; a four-backtick outer fence handles embedded ``` natively.shell-env.tsTERM=dumb override is fine but unrelated; better as its own two-line PR.
|
Follow-up pushed in Implementation shape:
I also updated the PR body so it no longer lists tracker-backed issue detail injection as follow-up work. |
neversettle17-101
left a comment
There was a problem hiding this comment.
I found one restore-path gap that looks worth fixing before merging.
The manager now re-derives and passes SystemPrompt/SystemPromptFile through RestoreConfig, but most native restore adapters still drop those fields. For example Codex restore builds codex resume ... <agentSessionID> without the same -c model_instructions_file=... / developer instructions flags used on fresh launch, and Cline restore similarly omits -s. Because restoreArgv prefers native restore when agentSessionId exists, restored sessions for these harnesses will silently lose AO's generated standing instructions even though fresh launches receive them.
This arises after daemon restart/session restore, specifically when the adapter can natively resume instead of falling back to fresh launch. Please either re-apply the supported system-prompt flags in each restore adapter that supports them, or document/test the adapters where resume cannot accept system prompts so the behavior is explicit.
|
Follow-up pushed in Shape:
|
…-2272-prompts # Conflicts: # backend/internal/adapters/agent/amp/amp.go # backend/internal/adapters/agent/amp/amp_test.go # backend/internal/adapters/agent/continueagent/continueagent.go # backend/internal/adapters/agent/kiro/kiro.go # backend/internal/adapters/agent/kiro/kiro_test.go # backend/internal/session_manager/manager.go
|
Addressed the latest @neversettle17-101 / @illegalcall prompt comments in f151fe8. Changes made:
Verification:
All review threads are currently resolved in GitHub; these latest notes were top-level comments rather than resolvable review threads. |
|
Low: |
|
@neversettle17-101 addressed your latest command-catalog text drift note in 4bec0db. The This was docs-only; I ran |
nikhilachale
left a comment
There was a problem hiding this comment.
AO Orchestrator — Agent Compatibility
Summary Table
| Agent | AO system prompt injected? | Orchestrator launch shape | Likely result |
|---|---|---|---|
| vibe | Yes | Custom .vibe agent via --add-dir --agent ao-system-prompt | Works as orchestrator |
| droid | Yes | Interactive droid --append-system-prompt ... | Should work, but may need to explicitly spawn/select orchestrator |
| cline | Yes | Promptless launch stays interactive, uses -s | Should work as orchestrator |
| pi | Yes | pi --print --append-system-prompt ... | Has prompt, but print/headless behavior is suspect for long-lived orchestrator |
| devin | No | devin [-p prompt], ignores SystemPrompt | Missing AO role instructions |
| grok | No | grok --no-auto-update [-p prompt], ignores SystemPrompt | Missing AO role instructions |
| kimi | No | kimi -p for prompted, interactive without prompt; comments say no system prompt flag | Missing AO role instructions |
| crush | No | Interactive crush ..., comments say no native system prompt support | Missing AO role instructions |
Concrete Code References
- devin —
backend/internal/adapters/agent/devin/devin.go:82builds args but never readscfg.SystemPrompt. - grok —
backend/internal/adapters/agent/grok/grok.go:75— same issue: prompt and permission flags only, no system prompt. - kimi —
backend/internal/adapters/agent/kimi/kimi.go:13explicitly says AO's system prompt is not injected. - crush —
backend/internal/adapters/agent/crush/crush.go:61explicitly says system prompt is ignored. - cline —
backend/internal/adapters/agent/cline/cline.go:74does inject with-s. - droid —
backend/internal/adapters/agent/droid/droid.go:90injects with--append-system-prompt. - vibe —
backend/internal/adapters/agent/vibe/vibe.go:94creates/uses the custom AO system-prompt agent.
Conclusion
Devin, Grok, Kimi, and Crush are probably not working as orchestrators because AO currently cannot deliver the orchestrator role prompt to them. They may still launch, but they won't know "I am the orchestrator, coordinate via workers, don't implement."
For Droid, Cline, and Vibe, the system prompt path exists, so failures there are more likely spawn/config/UI selection issues, not missing prompt injection.
Note: even though Droid and Vibe do receive the orchestrator system prompt, they don't automatically act as orchestrator on launch — a spawn/select step (explicitly instructing them to take on the orchestrator role) is still required. So prompt injection is necessary but not sufficient; the launch flow also needs to explicitly trigger orchestrator behavior rather than assuming it follows from the prompt alone.
Confirmed Working SetThese agents have a real AO standing-instruction path:
ConclusionThe pattern is clear:
UntestedAll remaining agents beyond the ones listed above have not been tested yet. |
…ue-2272-prompts # Conflicts: # backend/internal/adapters/agent/continueagent/continueagent.go # backend/internal/adapters/agent/devin/devin.go # backend/internal/adapters/agent/pi/pi.go # backend/internal/adapters/agent/pi/pi_test.go # backend/internal/adapters/agent/qwen/qwen.go # backend/internal/lifecycle/reactions.go # backend/internal/session_manager/manager.go # backend/internal/session_manager/manager_test.go # frontend/src/shared/shell-env.test.ts # frontend/src/shared/shell-env.ts
…-2272-prompts # Conflicts: # backend/internal/lifecycle/reactions.go
…support and system prompt handling
|
Main Behavior Changes
|




Fixes #2272
Refs #2371
Summary
prompts/<session-id>/system.md, with cleanup on failed spawn, kill, delete, restore failure, and cleanup paths.SystemPromptandSystemPromptFilethrough fresh launch, native restore, and restore fallback launch configs so supported adapters retain AO standing instructions.--issuespawns, keeping issue details in the task prompt and out of the system prompt.IssueContextin the session service from the daemon-wired GitHub tracker before spawning workers, with graceful fallback when tracker context is unavailable.Tests
go test ./internal/service/session ./internal/session_manager ./internal/daemoncd backend && go test ./...npm run lintKnown risks / follow-ups
AO_GITHUB_TOKENorGITHUB_TOKEN; when unavailable, workers retain the existing issue-only fallback prompt.