Skip to content

chore: cover queued session rotation regression - #106995

Merged
joshavant merged 1 commit into
mainfrom
test/issue-103683-queued-reset-regression
Jul 14, 2026
Merged

joshavant merged 1 commit into
mainfrom
test/issue-103683-queued-reset-regression

Conversation

@joshavant

Copy link
Copy Markdown
Collaborator

Related: #103683

What Problem This Solves

Adds durable coverage for a failure where a /new replacement turn could be accepted while an earlier turn was active, then disappear before agent_turn_prepare or model invocation during session cancellation and rotation.

Why This Change Was Made

The test starts an isolated real Gateway with a held mock OpenAI-compatible response and a temporary agent_turn_prepare tracer plugin. It submits /new while the first turn is active, then verifies the replacement reaches both the hook and model boundaries. This is regression coverage for the queued-turn lifecycle fix in #100123; it does not change runtime behavior.

User Impact

No direct runtime change. CI now protects the session-rotation path implicated by #103683 from regressing.

Evidence

  • Immediate pre-fix parent 3dff585de62ed85597258868dffc70dd700a608c: the unchanged test fails with one model request instead of two and no replacement-turn progress (blacksmith-testbox tbx_01kxf4j61vfa3dnmxfmpsr68y0).
  • Current branch: corepack pnpm test test/gateway-queued-session-rotation.e2e.test.ts passes on blacksmith-testbox tbx_01kxf5scrhs5m22896tt2m7291 (run).
  • corepack pnpm check:changed passes the root-test/tooling lanes on blacksmith-testbox tbx_01kxf57smxaxqpmbz22pemtbpr (run).
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main: clean, no accepted/actionable findings.

AI-assisted: implemented and validated with Codex; I reviewed the resulting test and evidence.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Jul 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 10:12 PM ET / July 14, 2026, 02:12 UTC.

Summary
Adds an end-to-end Gateway regression test that holds an active model response, submits /new, and verifies the queued replacement reaches both agent_turn_prepare and model invocation after session rotation.

PR surface: Tests +299. Total +299 across 1 file.

Reproducibility: no. current-main failure is reproduced: the supplied evidence instead shows the new test failing on the immediate pre-fix parent and passing after the queued-turn lifecycle fix. That is useful historical regression proof, but it is not a failing current-main reproduction.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: test/gateway-queued-session-rotation.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted real-provider Gateway evidence showing the queued /new replacement reaches model invocation after rotation.
  • Request a fresh full review once the complete repository test and sibling harnesses can be inspected.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR reports a real isolated Gateway and convincing pre-fix/after-fix Testbox runs, but model behavior is mocked; add redacted real-provider terminal output or logs, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Risk before merge

Maintainer options:

  1. Decide the mitigation before merge
    Keep the focused regression test if a complete source review confirms stable harness usage, add redacted real-provider Gateway evidence for the queued /new flow, and continue tracking the broader embedded-run liveness problem separately.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The protected maintainer label, mock-only proof, and incomplete full-file audit require maintainer review rather than an automated repair or cleanup action.

Maintainer decision needed

  • Question: Should this test-only PR require a real-provider queued /new Gateway run, or should maintainers explicitly override the proof gate for its isolated real-Gateway/mock-model evidence?
  • Rationale: The patch changes only regression coverage and reports strong before-and-after Testbox results, but repository policy says tests and mocks are supplemental rather than sufficient real-behavior proof for an external PR.
  • Likely owner: steipete — The underlying queued-turn lifecycle implementation and its previous land-ready proof were owned and merged through this person's history.
  • Options:
    • Require real-provider proof (recommended): Ask for redacted terminal or runtime logs showing an active real-provider turn followed by queued /new reaching the replacement model invocation.
    • Override for test-only scope: A maintainer may explicitly accept the isolated real-Gateway evidence because the PR changes no runtime behavior.

Security
Cleared: The supplied change is confined to a test file using built-in Node servers and existing repository helpers, with no concrete security or supply-chain regression identified.

Review details

Best possible solution:

Keep the focused regression test if a complete source review confirms stable harness usage, add redacted real-provider Gateway evidence for the queued /new flow, and continue tracking the broader embedded-run liveness problem separately.

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

No current-main failure is reproduced: the supplied evidence instead shows the new test failing on the immediate pre-fix parent and passing after the queued-turn lifecycle fix. That is useful historical regression proof, but it is not a failing current-main reproduction.

Is this the best way to solve the issue?

Likely yes: a focused Gateway-level test spanning queue admission, session rotation, plugin preparation, and model invocation is the appropriate durable boundary. Final confidence requires reading the complete test and sibling E2E harnesses to rule out timing-sensitive or duplicate coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6e067f7662f9.

Label changes

Label changes:

  • add P2: The PR adds focused protection for a queued-session lifecycle regression that can otherwise suppress a replacement turn, while introducing no runtime behavior change.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports a real isolated Gateway and convincing pre-fix/after-fix Testbox runs, but model behavior is mocked; add redacted real-provider terminal output or logs, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Label justifications:

  • P2: The PR adds focused protection for a queued-session lifecycle regression that can otherwise suppress a replacement turn, while introducing no runtime behavior change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports a real isolated Gateway and convincing pre-fix/after-fix Testbox runs, but model behavior is mocked; add redacted real-provider terminal output or logs, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Tests +299. Total +299 across 1 file.

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

What I checked:

Likely related people:

  • steipete: Authored and merged the queued-prompt lifecycle work that this regression test targets, including the Gateway cancellation and session-ownership paths. (github.com) (role: introduced and merged related behavior; confidence: high; commits: 1b8d83767445; files: src/gateway/server-methods/chat.ts, src/tui/tui-session-actions.ts)
  • Sebastien Tardif: The merged queued-prompt lifecycle commit credits Sebastien Tardif as a co-author, making them relevant to the behavior covered by this test. (github.com) (role: contributed the underlying queued-turn implementation; confidence: medium; commits: 1b8d83767445; files: src/gateway/server-methods/chat.ts, src/tui/tui-session-actions.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@joshavant
joshavant merged commit 177ad6b into main Jul 14, 2026
167 of 173 checks passed
@joshavant
joshavant deleted the test/issue-103683-queued-reset-regression branch July 14, 2026 05:20
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant