Skip to content

feat(ambient): require self-contained context in delegation prompts - #304

Merged
dean0x merged 2 commits into
mainfrom
feat/ambient-self-contained-delegation
Aug 25, 2026
Merged

feat(ambient): require self-contained context in delegation prompts#304
dean0x merged 2 commits into
mainfrom
feat/ambient-self-contained-delegation

Conversation

@dean0x

@dean0x dean0x commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

The orchestrator charter tells the orchestrator session what to delegate and to which model tier, but never stated that subagents start with a blank context. This led to observed failures where the orchestrator asked an agent to create a GitHub issue summarizing the conversation without passing the conversation's substance — the issue came out missing key information and needed a second pass to fix.

This PR adds one operating rule to the charter that closes this gap.

Changes

New operating rule in src/assets/scripts/hooks/assets/orchestrator-charter.md (inserted after the "Decompose mainline" bullet, before "Parallelize"):

- Subagents see none of this conversation. Make every delegation self-contained: goal, constraints, relevant session decisions and facts, exact paths. A deliverable that draws on the conversation (issue, PR, report) needs the substance in the prompt — not a pointer to it.

Mechanical consequences:

  • Charter byte count: 2177 → 2452 bytes (~600 tokens); well within the 4096-byte runtime limit enforced by session-start-orchestrator
  • CLAUDE.md: updated token estimate from ~535 to ~600
  • CHANGELOG.md: entry added under ## [Unreleased]
  • Runtime copy at ~/.devflow/scripts/hooks/assets/orchestrator-charter.md synced; diff confirms files are identical

Breaking Changes

None.

Reviewer Focus Areas

  • Exact wording of the new bullet matches the user-approved text verbatim
  • No other operating rules or preamble cross-references were touched
  • Charter byte count stays well under 4096 bytes

Test Results

tests/ambient.test.ts             50 passed
tests/shell-hooks.test.ts        177 passed  (includes AC-P3: charter <4096 chars)
tests/integration/ambient-activation.test.ts  2 passed
Total: 229 passed, 0 failed

dean0x and others added 2 commits August 25, 2026 23:43
Add an operating rule to the orchestrator charter: every subagent
delegation must be self-contained — goal, constraints, relevant session
decisions and facts, and exact paths. Deliverables that draw on the
conversation (issues, PRs, reports) must carry the substance in the
prompt rather than a pointer to it.

Charter grows from 2177 → 2452 bytes (~600 tokens), well within the
4096-byte runtime limit enforced by session-start-orchestrator.

Sync installed runtime copy and update CLAUDE.md token estimate.

Co-Authored-By: Claude <noreply@anthropic.com>
@dean0x
dean0x merged commit 77fc1c2 into main Aug 25, 2026
2 of 3 checks passed
@dean0x
dean0x deleted the feat/ambient-self-contained-delegation branch August 25, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant