Show the pinned session mode on the delegation card - #501
Open
Adam-Dalloul wants to merge 3 commits into
Open
Conversation
A parent agent can already choose WHICH agent runs a delegated task, but not how much that child may do unattended. The child inherits whatever session mode the per-agent delegation default in Settings happens to be. For a one-off delegation that is the wrong granularity: you may want a specific child kept on a prompting or approval mode without changing the global default for that agent. Adds an optional `permission_mode` to `delegate_to_agent`. It is the target agent's own session mode id, the same vocabulary `AgentDelegationDefaults::mode_id` already uses, and it is forwarded verbatim as `ConnectionSpawner::spawn`'s existing `preferred_mode_id`, so no new mechanism is introduced. Behaviour: - omitted: configured default is used unchanged, so there is no behaviour change for existing callers and non-delegated sessions are untouched - provided: overrides the Settings default for that one call - blank or whitespace is treated as omitted, so a model emitting "" cannot clear the configured default by accident - agents exposing no session modes ignore it This is a cooperative permission scope enforced by the agent, not an OS sandbox. The schema description says so rather than implying isolation. Tests: per-call override beats the agent default; omitting keeps the default; override works with no agent default configured.
When a parent pins a session mode for one delegated child, nothing in the transcript records it. Reviewing a conversation afterwards you can see which agent ran and what it was asked to do, but not what it was allowed to do without being asked. Surfaces it as a quiet monospace chip beside the task id, rendered only when the parent actually pinned a mode. A card with no chip means the child used the configured per-agent default, which is the common case, so existing transcripts look unchanged. The value comes from the parsed `permission_mode` argument, so no new wire field is needed. Hosts that strip tool arguments simply show no chip, which reads correctly rather than misleading. Tests: parses and trims the value, treats blank as absent, leaves it null when the argument is omitted.
Contributor
Author
|
Review order: merge #499 first. Cross-fork PRs cannot use a fork branch as their base, so this is opened against main and currently shows #499's commit too. Once #499 lands, this diff collapses to its own single commit. Only the second commit, 'show the pinned session mode on the delegation card', is new here. |
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.
Stacks on #499, which adds the optional
permission_modeargument. This PR is the read side of it.Problem
When a parent pins a session mode for one delegated child, nothing in the transcript records it. Reviewing a conversation afterwards you can see which agent ran and what it was asked to do, but not what it was allowed to do without being asked. That is the one detail you want when auditing what a sub-agent was permitted to touch.
Change
A quiet monospace chip beside the task id on the delegation card, rendered only when the parent actually pinned a mode.
permission_modeargument, so there is no new wire field, no broker change, and no migration.parseInputnow also recognises a lonepermission_modeas delegation args, matching howtask/agent_type/working_dirare each treated as sufficient.The tooltip string is added to all ten locale files with the English text, for translators to pick up.
Tests
Three added to
delegation-card.test.ts: parses and trims the value, treats a blank string as absent, leaves it null when the argument is omitted.Verification
Run locally on this branch:
npx tsc --noEmit -p tsconfig.jsonclean, exit 0npx vitest run src/components/message/ src/lib/delegation-card.test.ts31 files, 344 tests, all passingnpx eslintreportsDelete ␍on these files, but it does so on untouched files too (276 ondelegation-settings.tsx), so that is this Windows checkout's CRLF state rather than anything in this change. The committed diff is 57 insertions with no line-ending churn.