Bound Codex-Session Context Intake (#4280)#4281
Merged
Merged
Conversation
…urfaces Introduce CODEX_INTAKE_DISCIPLINE_DIGEST with numeric read rules and sub-agent spawn discipline. Wire through the injector chain and all four Codex delivery surfaces (skill, food-truck, interactive, agent TOMLs) plus build_resume_cmd prepend. Claude Code surfaces explicitly excluded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ck 39 Rewrite AGENTS.md §5 preamble to mark the package table as an index. Add per-repo Codex output ceiling guidance to configuration.md and ADR-0005. Add CODEX_LIMITS_LAST_VERIFIED_VERSION pin and doctor Check 39 (codex_limits_verified) with extracted version-parse helper. Update stale doctor check counts in docs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…elivery guarantees T1-T2: intake digest content pins and TOML safety guard. T3: fresh headless and food-truck include intake digest. T4: interactive and agent-TOML two-digest composition. T5: interactive developer_instructions exact-string assertions. T6: Claude backend negative delivery guarantee. T7: doctor codex_limits_verified (4 cases: warn, ok, between-pins, skip). T8: ADR-0005 per-repo ceiling and upgrade tracking ratchets. T9: AGENTS.md package table marked as index. T10: injector chain registry and backend-conditional tests. T11: resume cmd prepend pin + Claude negative guard. T12: doctor count ratchet bumped to 47, backend registry exports updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix cross-package import in _doctor_runtime.py (import via execution/, not execution/backends/_codex_config). Bump codex.py line limit exemption (1210->1212), doctor __init__.py limit (253->257), and type_constants symbol count ratchet (110->112). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Trecek
commented
Jul 18, 2026
Trecek
left a comment
Collaborator
Author
There was a problem hiding this comment.
AutoSkillit PR Review — Verdict: approved_with_comments
Trecek
commented
Jul 18, 2026
Trecek
left a comment
Collaborator
Author
There was a problem hiding this comment.
AutoSkillit review: warning-only findings detected. See inline comments — no blocking changes required.
…CodexVersionResult NamedTuple Addresses reviewer finding: the tuple[int,int,int] | str union used a bare string as the skip-reason sentinel with no static safety net for future call sites. CodexVersionResult(parsed, skip_reason) makes misuse unrepresentable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… eliminate dual-mechanism drift The digest-pair ordering (OUTPUT_DISCIPLINE_DIGEST + CODEX_INTAKE_DISCIPLINE_DIGEST) was encoded independently in both _CODEX_DISCIPLINE_SUFFIX (codex.py) and the injector chain sequence (_claude_prompt.py). Adds codex_discipline_suffix() to _claude_prompt.py as the single source of truth and has codex.py import it, eliminating the silent drift risk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The forward obligation cited 'Verification 6 in the implementation plan' but no implementation plan is committed and issue #4280 contains no verification sections, making the gating criterion untraceable. Replaced with an inline description of the operative constraint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 20, 2026
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
Codex-backend sessions (gpt-5.6-sol,
code_mode_only) repeatedly exhaust their context window through aggressive file intake because upstream Codex removed its read-chunking guidance and honors model-declaredmax_output_tokensunclamped. This plan bounds Codex context intake on four fronts:CODEX_INTAKE_DISCIPLINE_DIGESTconstant carrying the issue's numeric rules (at most 2 files per exec command; never read a file end-to-end; never passmax_output_tokensabove 10000; open at most 2 files after a directory listing; AGENTS.md package tables are an index) plus the sub-agent spawn rules (fresh context via explicitfork_turns "none"). The digest is injected into every fresh-launch Codex delivery surface through the existing prompt-injector chain anddeveloper_instructionscomposition points. Claude Code sessions never receive it.docs/configuration.mdand ADR-0005 document the two lower-ceiling launch paths for non-autoskillit repos, capping casual reads at ~40 KB.CODEX_LIMITS_LAST_VERIFIED_VERSION = (0, 144, 1)pin and doctor Check 39 (codex_limits_verified) that WARNs when the installed CLI is newer than the pin.Requirements
REQ-RD-001: Codex sessions must receive a numeric instruction limiting file reads to at most 2 files per exec command.
REQ-RD-002: Codex sessions must be instructed to never read a file end-to-end, using ranged reads (
rg -nwith context, orsed -nranges of at most 250 lines) instead.REQ-RD-003: Codex sessions must be instructed to never pass
max_output_tokensabove 10000.REQ-RD-004: Codex sessions must be instructed to open at most 2 of the files returned by a preceding directory listing.
REQ-RD-005: The AGENTS.md package table must be documented as an index rather than required reading, with per-package AGENTS.md consulted only for packages being modified.
REQ-SUB-001: Codex sessions must be instructed to spawn sub-agents with fresh context rather than
fork_turns:"all".REQ-SUB-002: Sub-agent spawn instructions must require an explicit narrow brief per sub-agent and specify that only a summary is returned to the parent.
REQ-CFG-001: A lower-ceiling launch path (per-project
CODEX_HOME, or a-c tool_output_token_limit=Noverride) must be documented for non-autoskillit repos.REQ-CFG-002: The documented per-repo ceiling must cap casual reads at approximately 40KB of output, down from the ~218KB produced by the autoskillit-sized default.
REQ-DEP-001: The codex-cli upgrade path must be tracked to capture the larger upstream gpt-5.6-sol context window (372,000 tokens vs. 258,400 tokens in the cli 0.144.1 registry).
REQ-DEP-002: Autoskillit's derived constants (
CODEX_TOOL_OUTPUT_TOKEN_LIMIT, the auto-compact sentinel) must be verified consistent with the upstream registry after any codex-cli upgrade.Closes #4280
Implementation Plan
Plan file:
/home/talon/projects/generic_automation_mcp/.autoskillit/temp/make-plan/codex_context_intake_plan_2026-07-17_183300.md🤖 Generated with Claude Code via AutoSkillit