Skip to content

fix(tests): restore runtime context guard coverage - #189888

Closed
vincentkoc wants to merge 2 commits into
mainfrom
test-runtime-precheck-fixtures-20261101
Closed

vincentkoc wants to merge 2 commits into
mainfrom
test-runtime-precheck-fixtures-20261101

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Disposition

Superseded by #189891. That rollback removed the unconditional provider-bound context checks introduced in #189810 and restored the canonical overflow recovery message.

The proposed 128,000-token fixture window no longer has a demonstrated current failure to repair. The proposed recovery-message assertion conflicts with the restored production text. This PR is closed without merging.

Historical evidence

Against the pre-rollback guard, the shared 4,096-token model caused lifecycle scenarios to fail before their assertions. The default three-file batch changed from 12 failures and one pass to 13 passes after increasing that model's window; explicit-runtime consumers also passed on a qualified carrier. That proof establishes the original mismatch, not a need for larger fixtures after the rollback.

Final-head CI tested merge 3eb2ee71868e, based on e515a095c5b5, and failed only the now-stale recovery-message assertion in the changed test selection: https://github.com/openclaw/openclaw/actions/runs/41258401484/job/124706803779. No insufficient-context-budget signature was reported in that selection.

@vincentkoc vincentkoc self-assigned this Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Nov 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 1, 2026 00:17
@vincentkoc
vincentkoc enabled auto-merge (squash) November 1, 2026 00:23
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@vincentkoc
vincentkoc disabled auto-merge November 1, 2026 00:42
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR enlarges explicit-runtime subagent test fixtures to 128,000 tokens and updates a scheduled-overflow assertion.

Example: A subagent fixture selects runtime: true.

  • Before: The synthetic model advertises a 4,096-token context window.
  • After: The synthetic model advertises a 128,000-token context window while retaining its 1,024-token output limit.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Focused harness evidence supports the original repair, but the merged rollback supersedes its motivation and makes the changed assertion incompatible with current main.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only PR reports Gateway/model harness failures before and passes after the fixture correction; those results exercise the earlier admission policy and do not resolve the current-main assertion mismatch.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: No · Fix scope: Complete
User problem: Regression fixtures failed before reaching their intended subagent assertions under the now-reverted admission policy.
Reason: The original repair direction was maintainer-authorized, but the subsequently merged rollback removed its motivating policy and restored the wording this PR replaces.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open for maintainer disposition: the merged context-admission rollback removes this PR’s original motivation, and its overflow assertion would fail against current main.

Priority: P2
Reviewed head: dfc57e62d20d58c1aa9bbf2befdaef3604028c00

Before merge

  • Keep the overflow expectation aligned with the merged rollback (P2) - When this PR is merged onto current main, scheduled-failure-context-overflow will expect “The context window was exceeded mid-turn”, but buildContextOverflowRecoveryText() now returns “Auto-compaction could not recover this turn”. The deliberate rollback in revert: default hard context admission (#189810) #189891 restored that producer text without changing this test file, so GitHub reports a clean merge while the assertion would fail. Drop this assertion edit and retain the restored expectation.
  • Product: not worth merging - The original repair direction was maintainer-authorized, but the subsequently merged rollback removed its motivating policy and restored the wording this PR replaces.

Findings

  • [P2] Keep the overflow expectation aligned with the merged rollback — src/auto-reply/reply/session-event-config-readmission.test.ts:517

Tests

  • Missing end-to-end proof: The reported pre/post harness results cover the earlier admission policy, not the restored current-main recovery contract.
Agent review details

How this fits together

Gateway product tests use the shared synthetic-model configuration to exercise subagent workflows, while scheduled-event tests check how runtime failures reach completion receipts.

flowchart TD
  A[Product test] --> B[Shared model fixture]
  B --> C[Isolated Gateway]
  C --> D[Scripted model server]
  D --> E[Subagent completion]
  E --> F[Behavior assertions]
Loading

Technical review

Best possible solution:

The maintainer should withdraw the superseded repair or retain only a fixture adjustment with a demonstrated need on current main.

Do we have a high-confidence way to reproduce the issue?

Source establishes the mismatch: the scheduled overflow scenario produces the restored recovery text, which cannot contain this PR’s expected substring; no tests were executed during this read-only review.

Is this the best way to solve the issue?

The two-line repair was focused for its original base, but the deliberate rollback restores the original contract and makes the assertion replacement incorrect for current main.

Full review comments:

  • [P2] Keep the overflow expectation aligned with the merged rollback — src/auto-reply/reply/session-event-config-readmission.test.ts:517
    When this PR is merged onto current main, scheduled-failure-context-overflow will expect “The context window was exceeded mid-turn”, but buildContextOverflowRecoveryText() now returns “Auto-compaction could not recover this turn”. The deliberate rollback in revert: default hard context admission (#189810) #189891 restored that producer text without changing this test file, so GitHub reports a clean merge while the assertion would fail. Drop this assertion edit and retain the restored expectation.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7f593b69e7ab.

Provenance checked

  • Scheduled-overflow expectation changes intended behavior with a stated reason (1bf930c: The scheduled-readmission repair retained failure settlement and recovery guidance; the later admission change altered that guidance, and the merged rollback explicitly restored it.)
  • Shared subagent model fixture keeps the original intent (6344453: Fixture consolidation retained distinct lifecycle and routing contracts; later consolidation added the explicit-runtime selector. This PR preserves default Stop budgets and delivery assertions.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Tests 0. Total 0 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 2 2 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 2 2 0

Labels

Label changes:

  • add P2: The patch would introduce a deterministic test expectation mismatch after the merged rollback, without changing shipped runtime behavior.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The patch would introduce a deterministic test expectation mismatch after the merged rollback, without changing shipped runtime behavior.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 31, 2026, 8:46 PM ET / November 1, 2026, 00:46 UTC.

@vincentkoc

Copy link
Copy Markdown
Member Author

Superseded by #189891, which reverted the unconditional context-admission change and restored the canonical recovery copy. The larger fixture budget no longer has a demonstrated current failure to repair, and the copy edit conflicts with the restored behavior. Closing without merging.

@vincentkoc vincentkoc closed this Nov 1, 2026
steipete added a commit that referenced this pull request Nov 1, 2026
)

* fix(agents): compact long tool turns and publish current context totals

Start client maintenance at 75% of the active context window while preserving
provider and native compaction ownership. Check every prepared request against
the hard window using nominal occupancy, calibrated tool-result estimates, and
provider-measured context plus pending additions.

Publish current context through the existing guarded session writer and let
final ordered accounting supersede intermediate snapshots. Retire downstream
mixed-counter repairs; invalidate old prompt-only freshness stamps without a
schema change or new configuration.

Preserve the working 32k prompt-cache fixture and repair impossible lifecycle
fixture windows from the reverted admission rollout. Include red-on-parent
long-turn/accounting regressions and repair the cold native-auth test setup.

Related: #189810, #189891, #189888, #164551.
Co-authored-by: Alex Mittell <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* fix(agents): complete nominal context admission and accounting cutover

* fix(agents): share lexical pricing with compaction summary fitting

* test(agents): align context consumers and isolate announce state

* test: await archive and steering fixture handoffs

Join the database lifecycle before raw archive fixture seeding, and wait for
runtime steering admission before releasing the held document request.
Preserve the existing behavior assertions and allocate exact regression lines.

Archive admission passes 17/17; steering passes 6/6. The CI assertions did not
reproduce locally, but diagnostic probes exposed the asynchronous fixture
handoffs. Fresh Codex review found no actionable findings.

---------

Co-authored-by: Alex Mittell <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…claw#190017)

* fix(agents): compact long tool turns and publish current context totals

Start client maintenance at 75% of the active context window while preserving
provider and native compaction ownership. Check every prepared request against
the hard window using nominal occupancy, calibrated tool-result estimates, and
provider-measured context plus pending additions.

Publish current context through the existing guarded session writer and let
final ordered accounting supersede intermediate snapshots. Retire downstream
mixed-counter repairs; invalidate old prompt-only freshness stamps without a
schema change or new configuration.

Preserve the working 32k prompt-cache fixture and repair impossible lifecycle
fixture windows from the reverted admission rollout. Include red-on-parent
long-turn/accounting regressions and repair the cold native-auth test setup.

Related: openclaw#189810, openclaw#189891, openclaw#189888, openclaw#164551.
Co-authored-by: Alex Mittell <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* fix(agents): complete nominal context admission and accounting cutover

* fix(agents): share lexical pricing with compaction summary fitting

* test(agents): align context consumers and isolate announce state

* test: await archive and steering fixture handoffs

Join the database lifecycle before raw archive fixture seeding, and wait for
runtime steering admission before releasing the held document request.
Preserve the existing behavior assertions and allocate exact regression lines.

Archive admission passes 17/17; steering passes 6/6. The CI assertions did not
reproduce locally, but diagnostic probes exposed the asynchronous fixture
handoffs. Fresh Codex review found no actionable findings.

---------

Co-authored-by: Alex Mittell <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant