Repository navigation
fix(coding-agent): preserve delegated message trust guidance - #142
Merged
Issacboy123 merged 1 commit intoAug 29, 2026
Merged
Issacboy123 merged 1 commit into
Issacboy123 merged 1 commit into
Conversation
Pepps233
approved these changes
Aug 28, 2026
| const CURRENT_PLAN_RESTORATION_REMINDER = | ||
| "Reminder: restored context is not proof of completion. Verify current state before claiming work is done."; | ||
| const MAX_PENDING_SUBAGENT_ESCALATION_CHARACTERS = 8_000; | ||
| const SUBAGENT_DELEGATED_MESSAGE_TRUST_GUIDANCE = |
Contributor
There was a problem hiding this comment.
More testing should be done on this; if the parent begins validating every claim returned by the subagents, it defeats the purpose of having subagents (separation of context). This is ok to merge for now, but just keep the above in mind.
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
Hidden subagent results and escalations can contain untrusted claims or embedded instructions, but the existing escalation-only guidance could disappear when coordination tools were filtered or a custom or extension-returned system prompt was selected. This PR gives every controller-owning root session one combined trust suffix across prompt forms and rebuild paths.
Reasoning
Applying the guidance in
AgentSessionafter the effective system prompt is selected makes the trust boundary independent of tool availability and extension prompt replacement. Keeping the composition private avoids expanding the public prompt-building API and preserves the existing custom-message roles, persistence, delivery, and display behavior.Changes
subagent_resultsandsubagent_escalations.Testing
node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-parent-messaging.test.tsnode ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-services.test.ts test/suite/subagent-registration.test.ts test/suite/subagent-coordination.test.ts test/suite/subagent-parent-messaging.test.ts test/subagent-controller.test.tsnpm run check