Harden headless boundaries and model-facing prompt metadata - #7
Merged
Conversation
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
This review PR applies the low-risk fixes found while auditing v3.1.1 (
78c71d35) and keeps larger behavior changes as explicit follow-ups.1. Design / bug fixes
maxConcurrentSubagentsas a positive integer before headless execution.subagentTimeoutMsandworkflowTimeoutMsas non-negative integers, so negative/ fractional values cannot silently disable a subagent timeout or become an accidental immediate workflow timeout.HeadlessUsagesnapshots by cloning the nestedcostobject on callbacks/results/errors. Previously the initialonSubagentStartsnapshot sharedusage.costwith the live accumulator and could change after the callback returned.2. Prompt hardening
3. Documentation / tests
test/readme.test.ts: keep package/link validity and verify that documented profile examples are parseable, but stop pinning the README to exactly two natural-language examples, exactly three profile examples, and specific example model IDs/text.4. Maintainability
setTimeout/ timeout-helper behavior.Review findings intentionally not changed here
These are higher-impact contract/security changes and should be handled separately:
ctx.isProjectTrusted(), while Codex uses--dangerously-bypass-approvals-and-sandboxand Claude uses--dangerously-skip-permissions.workflow: falseleaves workflow instructions in the system prompt.run_workflowis not registered, butbefore_agent_startstill injects the workflow authoring guide and saved-workflow roster.run_agent.promptaccepts empty/whitespace-only strings.labelhas a non-whitespace schema constraint;promptdoes not.AGENTS.mdandCLAUDE.mdduplicate a large evolving contract/history surface. Consolidating them needs an explicit decision about which file is canonical for each agent harness.Validation
test/headless.test.ts,test/subagent-contract.test.ts, andtest/readme.test.ts.