Support data-driven session agent identity in prompts - #177
Merged
Conversation
5 tasks
leoncheng57
force-pushed
the
feat/subagent-instruction-rows
branch
from
August 26, 2026 01:15
afb86ed to
9cd5e89
Compare
leoncheng57
changed the base branch from
feat/subagent-instruction-rows
to
main
August 26, 2026 01:20
leoncheng57
force-pushed
the
feat/session-agent-selection
branch
from
August 26, 2026 01:22
cd29321 to
6715bdc
Compare
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.
Stacked on #176. Closes #52 (narrowed scope).
What
Data-driven agent identity for main-session prompts. A session driven by an arbitrary roster agent (e.g. one started in the TUI with a custom agent) is now promptable from the web UI with its own identity — previously a hard "continue in the TUI" dead end.
Contract (each acceptance item from #52)
GET /api/session-agentsreturns the connected server's agents minus hidden internals and delegation-only (mode: "subagent") entries. Nothing is hardcoded.agentfield, exclusive withmode. The named agent must equal the session's own driving agent (session record + latest user message); a different roster agent is a 409SESSION_AGENT_MISMATCH. Nothing maps a foreign session to Build.mode(naming them viaagentis a 400), so the policy-activating path cannot be bypassed.SESSION_AGENT_UNAVAILABLEbefore anything is sent, and the composer shows the reason with send disabled.UI
opencode-session-agent-fixed) for foreign sessions — mirroring the Managed Child chip — with a live-roster availability state. The Plan/Build toggle is unchanged for Plan/Build sessions.Testing
tests/e2e/session-agents.spec.ts(owns its mock directory + fixtures per the shared-state ownership rule): catalogue filtering, foreign prompt with no policy patch, blend/remap refusals, vanished-agent failure, composer chip send, disabled composer honesty.modepath are unchanged and still pass.