Repository navigation
fix(context): respect accepted model limits in turns and compaction - #138087
zhangguiping-xydt wants to merge 82 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR carries accepted model capacity through context budgeting, CLI preparation, compaction, and publication-driven cache refresh. Example: A model reports 872,000 usable prompt tokens while its 128,000-token native-window estimate is marked synthetic.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR retains distinct, maintainer-engaged budget work beyond the merged discovery and reporting fixes; no actionable introduced defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherPrepared model catalogs supply capacity facts to shared context resolvers; embedded turns, CLI runtimes, and compaction consume the resulting budgets, while Gateway publications refresh their in-memory projection. flowchart TD
A[Accepted model catalog] --> B[Context cache projection]
C[Authored model limits] --> D[Shared context resolver]
B --> D
D --> E[Turn preparation]
D --> F[Compaction budget]
G[Native runtime facts] --> E
H[Catalog publication] --> B
Technical reviewBest possible solution: Use accepted capacity consistently across turns and compaction while preserving genuine ceilings, authored caps, and native-runtime ownership. Do we have a high-confidence way to reproduce the issue? Current-main source shows the compaction handoff omitting the synthetic marker and the cache resolver treating that estimate as a ceiling; the added cases cover these inputs, but no target code was executed during this review. Is this the best way to solve the issue? The existing budget and catalog owners are appropriate: the patch preserves capacity provenance, excludes unrelated native-runtime rows, and passively refreshes accepted publications without starting provider discovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2fc20b367b69. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +249, Tests +426, Other -1. Total +674 across 24 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (49 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 4:43 AM ET / 08:43 UTC (Revision 50). |
8816856 to
c06ccf0
Compare
|
September 7 continuation for this PR's existing owner: a current-main-compatible fork branch now preserves your original commits in ancestry and carries the remaining producer/scope fixes plus upgrade proof. No successor PR, push to your branch, or upstream merge. #141052 remains separate and unchanged. Source and adoption
Your exact Upgrade and producer proofPASS on the exact clean source head281a129: secretless hosted run34120617149. Two intended early-scope RED cases plus five producer/error RED cases were reproduced against the refreshed owner baseline, followed by 804/804 GREEN tests across21 explicitly verified files. The complete changed-file repository gate passed: core production and all core test type programs, lint/format, dead exports, boundaries, native/schema and remaining selected guards, zero runtime import cycles, and The follow-up itself is14 files, with production+71/-34 and tests+121/-2. Initial verification routing omissions were corrected by consulting canonical owner/auto-curated fast lanes and asserting every requested root appeared; fixture type and redundant-clone lint findings were fixed without widening schemas or suppressing rules. No earlier failed run is being represented as green. The unmocked trace uses production discovery projection and command accounting, real isolated SQLite persistence, and a separate cold Node process. Model metadata is synthetic; there is no provider call or operator-session mutation. The serialized source fields and source literals already exist; no session schema or migration is introduced. Native harness-owned policy stays private. Explicit runtime telemetry remains authoritative, and missing old producer tags are not relabeled.
A read-only test merge against inspected main Remaining boundary — deliberately not guessedThe same production-module audit still shows a generic scoped cache of This continuation does not claim that early stale-cache-versus-selected-live ownership is fully repaired. The existing selected-credential runtime preparation/rematerialization machinery is preserved, and its siblings are covered. A credential-owned prepared-fact handoff before early maintenance remains a focused owner follow-up. No unconditional per-turn network discovery is added, and this is not evidence that all local hotfixes can be retired. Required isolated autoreview was attempted but the Codex CLI is not logged in; no auth changes were made and no independent clean verdict is claimed. Tests and the production trace are not live inference-capacity proof. The one-time coordination question is already posted. I will check responses before a successor decision and hold until September 11, 10:40 UTC / 18:40 SGT unless a maintainer explicitly invites one sooner. This branch does not close or supersede your PR. September 11 source-only follow-upRechecked the complete issue/review conversations and timeline, including edited comments, and inspected your current head Current-main comparison (
The selected-credential live-metadata versus generic scalar-cache ownership gap described above remains separate; number comparisons alone do not justify raising a budget. No unconditional discovery, maximum-of-values workaround, session migration, merge, or closure is proposed here. |
|
@zhangguiping-xydt — would you prefer cherry-pickable follow-up commits for this PR, or a credited successor branch/PR for maintainer review? I can prepare the scope fix already linked above plus old/new session compatibility proof (legacy I will prepare only a fork branch for now, not push your branch or open a duplicate PR. I will check your response before any successor decision and wait until September 11, 10:40 UTC (18:40 SGT), unless a maintainer explicitly invites one sooner. This is coordination, not an inference about activity from PR age. Existing evidence: #138087 (comment) . |
|
/allow-security-sensitive-change |
1 similar comment
|
/allow-security-sensitive-change |
Additional source/guard evidence; budget scope unchangedI kept your existing budget/resolution owner intact and contributed the reporting-specific coverage to #165991 instead: one-file regression commit Fresh secretless/no-egress checks on your unchanged exact head The separate reporting owner-reversion control shows four expected failures/12 controls before its existing opt-out and 16/16 after, while omitted-flag execution cache lookup remains conservative. Keeping reporting facts separate must not silently alter this PR's execution/compaction policy. Sanitized proof, exact revisions, commands and test patch: https://gist.github.com/snotty/5030d0d5ca970b0ade000e3a9d7b4c64 . Counts belong to their recorded heads, not to a whole stack or today's main. These tests do not close the existing hosted CI/security, Windows/Copilot, upgrade, Telegram or provider-admission/integration gates; the PR remains unmerged. |
|
Thanks @zhangguiping-xydt for this. The context-limit problems it targets are now fixed on
We re-verified on current |
What Problem This Solves
Accepted model limits could be lost or combined with an unrelated runtime's limits during context budgeting, CLI preparation, and compaction.
User Impact
Turns and compaction use accepted provider capacity while respecting genuine native windows and explicit user caps. CLI-native runtimes retain their own limits. No new configuration, database fields, or migration is introduced.
Why This Change Was Made
The core Copilot discovery fix has landed. This follow-up carries those facts through shared budget consumers and refreshes the in-memory projection after accepted catalog publication. Startup prewarming consumes already prepared facts behind readiness and idle-work admission.
This PR already targets
mainand has no merge conflicts. Core discovery and persistence remain owned by main; saved-session provenance and accounting remain separate changes.Evidence
Current head:
6e35c691f2919c4313c4ed802bb87368857ee6a3. Incorporates main058cebea8e94with a conflict-free merge, preserving the separate 19-file budget change. Five additional files carry the small CI repairs below.38180826485, job114592980204: the same board-note assertion atboard-mcp-app.e2e.test.ts:579. The causal board test and sandbox inputs are unchanged by this PR.2b66ae6c3a3fixes the producer inventory; this head includes it. Direct execution of the actualcopyPrWrapperSourcesboundary passes with 2,296 entries and zero duplicates. No test expectation or guard was weakened.build-artifactsjob 114717283233, including the real built-CLI lifecycle proof. Its remaining two failures were test cutover issues: unsafe property access on an unknown dedupe entry and an old active-after-cleanup expectation. This head fixes both without casts or production changes. The full authorization/queue suites pass 48/48 in 33.02s wrapper wall time with one worker; fresh P0–P3 review is clean (.97).build-artifactsand its real built-CLI lifecycle proof. The related test shard and test-type failures are cleared. The sole substantive red is the unrelated tooling suppression inventory (checks-node-compact-small-1, job 114721152095): it observes 19 entries but expects 18 because main’s managed cleanup helper has a Bun fd-connect suppression. A clean checkout of current mainccb7b5f7e5dereproduces the identical failure (three tests pass, one fails, 7.70s wrapper wall time). Neither inventory owner is changed by this PR. No baseline exception, suppression, skip, or rerun was introduced; the aggregate gate remains red for that inherited failure. No merge requested; auto-merge is disabled.