Skip to content

Converge token-budget and model-visible context layout #708

Description

@shiny-code-bot

Objective

Converge the bounded <context_window>/token-budget schema and model-visible context grouping to the intended Every Code contract without rewriting history or adding unbounded fragments.

Finish Line

Initial, updated, compacted, resumed, root, and subagent contexts expose one deliberate bounded schema; tests no longer disagree between obsolete Agent name: expectations and current thread/context-window identifiers; environment permission/workspace updates remain model-visible and cache-stable.

Current Status

  • PR Preserve standalone bounded world-state fragments #724 is open on immutable commit 5201c1d337b26bcb4098f9fa7e24631edeb15d2d from branch code/issue-708-world-state-fragment.
  • Production fixes preserve requires_separate_message through both bounded-fragment paths and render filesystem context from the selected environment permission profile plus workspace roots. The compact context-limit fixture now supplies the seven failures required by the restored standalone history layout.
  • Focused validation is green: model-visible layout 8/8, token budget 34/34, MultiAgentV2 routing 2/2, bounded-fragment regression 1/1, prompt-cache prefix 1/1, environment update paths 2/2, permission-profile regression 1/1, and compact context-limit regression 1/1. Scoped just fix -p codex-core, just fmt, and git diff --check pass.
  • Snapshot review covered all 20 request-shape updates; changes are limited to intended standalone routing/order, current thread/context-window identifiers normalized as <THREAD_ID>, and bounded current-layout output. No .snap.new files remain.
  • Independent Opus review approves with no blocking defect. Gemini review is unavailable rather than approved: two managed Antigravity runs returned empty artifacts and the direct account route rejected the model as unsupported. IntelliJ changed-files inspection is also environment-blocked because the helper could not open the exact worktree and returned UNKNOWN with retry disabled.
  • Next action: babysit Preserve standalone bounded world-state fragments #724 through CI/review and merge, then reconcile this issue against the merged SHA and return the sole Now lane to Restore lab.5 release Rust test convergence #703 release validation.

Acceptance Criteria

  • Decide and document one bounded thread/agent identity schema in code and tests.
  • Preserve the ContextualUserFragment contract and hard size bounds.
  • Root and subagent usage guidance is present exactly once in intended grouping.
  • Environment permission profile and workspace-root changes remain visible when they change.
  • Token-budget/new-context/compaction tests and model-visible snapshots pass after explicit review.
  • No history rewrite or cache-churning repeated fragment injection is introduced.

Relationships

Metadata

Metadata

Assignees

No one assigned

    Labels

    planDurable planning issueplan:donePlan completed or superseded

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions