Skip to content

test(tui): route PTY gateway scenarios through explicit models - #118802

Merged
steipete merged 2 commits into
mainfrom
codex/qa0803-tui-pty-scenario-model-routing
Aug 3, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa0803-tui-pty-scenario-model-routing

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • restore explicit per-scenario model ownership for the real TUI Gateway/PTy E2E fixtures instead of brittle prompt-marker inference
  • preserve two agents, seven scenario models, one Gateway/PTy, real invalid-model failures, and response gating while removing six lines of test code

Verification

  • real installed OpenAI SDK and loopback HTTP: marker-free valid requests fail HTTP 400 before and succeed HTTP 200 after; invalid models remain observable HTTP 400
  • real production Gateway plus real PTy original-order scenarios: cancellation, collect, and validation all pass (3/3)
  • hosted before-fix RED failures inspected in jobs 91757707040 and 91751189859
  • focused formatting and git diff checks pass; production LOC delta 0, test LOC delta -6
  • independent single structured Sol/high/P1 autoreview clean, confidence 0.95

Complete real Gateway + real PTY production suite

The complete actual Gateway/WebSocket + PTY + loopback-provider suite passes all eight scenarios in original order, with no retries, timeout increases, assertion weakening, or mocks replacing the production Gateway:

local steering                  PASS  24.6s
gateway restart                 PASS  38.8s
cross-client delivery           PASS  72.1s
active-run followup             PASS 115.8s
visible empty reply             PASS  56.1s
cancellation                    PASS  56.0s
previously flaky collect        PASS  80.6s
previously flaky edit validation PASS 37.9s
Test Files: 1 passed; Tests: 8 passed

Both former hosted failure modes pass in the complete real production execution order.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 2:09 PM ET / 18:09 UTC.

ClawSweeper review

What this changes

The branch gives every real Gateway/PTy end-to-end scenario an explicit configured and session-selected model, replacing prompt-text routing and adding rejected-model diagnostics for stalled tests.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: this focused test repair is still needed because current main and release v2026.7.1 retain the prompt-marker routing it removes. The rebased head has no code changes since the prior clean review, and no actionable patch defect or non-obvious merge risk was found.

Likely related people

  • steipete — recent real Gateway/PTy fixture contributor (high confidence).

Priority: P3
Reviewed head: b6516c2e6d892df7fae4ad8411f54076582e0bbf

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, root-cause test-fixture repair with direct real-runtime proof and no supported correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides after-fix terminal output from the complete real Gateway/WebSocket plus PTY suite in original order, including all eight scenarios and the previously failing paths.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides after-fix terminal output from the complete real Gateway/WebSocket plus PTY suite in original order, including all eight scenarios and the previously failing paths.
Evidence reviewed 6 items Explicit scenario ownership: The branch assigns each agent entry its scenario model and registers all scenario models with the loopback provider, replacing the single shared-model arrangement.
Session boundary matches configuration: Each test session is patched to the same scenario-specific model before the shared PTY adopts it; request and rejected-request offsets preserve per-scenario diagnostics.
Current-main gap: The merge-base diff shows current main still routes the shared fixture through one advertised model and prompt-marker inference, while the PR removes that inference and routes by configured model identity.
Findings None None.
Security None None.

How this fits together

The TUI PTY suite drives a real Gateway server and terminal client against a loopback OpenAI-compatible model service. Scenario-specific model selection controls which deterministic response behavior the shared Gateway/PTY fixture receives, so the suite can verify cancellation, queueing, validation, and session behavior.

flowchart LR
  A[PTY scenario] --> B[Scenario model configuration]
  B --> C[Gateway session]
  C --> D[Session model selection]
  D --> E[Loopback model service]
  E --> F[Scenario response or rejection]
  F --> G[PTY and Gateway assertions]
Loading

Before merge

  • Complete next step (P2) - No mechanical repair remains; keep this PR for normal maintainer approval and exact-head merge gating.
Agent review details

Security

None.

PR surface

Tests -6. Total -6 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 35 41 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 35 41 -6

Review metrics

Metric Value Why it matters
Production versus test LOC production 0, tests −6 The change is confined to the end-to-end fixture and removes brittle routing code without altering shipped runtime or configuration behavior.

Technical review

Best possible solution:

Keep one canonical fixture path: bind each scenario to its declared model in agent and session configuration, retain rejected-request diagnostics, and land it once the exact rebased head meets normal merge gates.

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

Yes, from source: current main advertises one shared model and selects scenario behavior by prompt markers, while this branch binds the same scenarios to explicit configured models and session model selection. The PR body also supplies before/after real Gateway/PTy terminal evidence, though this read-only review did not rerun it.

Is this the best way to solve the issue?

Yes. Configuring model identity at the agent/session boundary is more maintainable than inferring test behavior from mutable prompt text, and it preserves the real Gateway and PTY execution path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This improves internal end-to-end test reliability and diagnostics without changing user-facing runtime behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides after-fix terminal output from the complete real Gateway/WebSocket plus PTY suite in original order, including all eight scenarios and the previously failing paths.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix terminal output from the complete real Gateway/WebSocket plus PTY suite in original order, including all eight scenarios and the previously failing paths.

Evidence

What I checked:

  • Explicit scenario ownership: The branch assigns each agent entry its scenario model and registers all scenario models with the loopback provider, replacing the single shared-model arrangement. (src/tui/tui-pty-local.e2e.test.ts:618, b6516c2e6d89)
  • Session boundary matches configuration: Each test session is patched to the same scenario-specific model before the shared PTY adopts it; request and rejected-request offsets preserve per-scenario diagnostics. (src/tui/tui-pty-local.e2e.test.ts:807, b6516c2e6d89)
  • Current-main gap: The merge-base diff shows current main still routes the shared fixture through one advertised model and prompt-marker inference, while the PR removes that inference and routes by configured model identity. (src/tui/tui-pty-local.e2e.test.ts:48, a67c52611e57)
  • Re-review continuity: The current rebased head has no changes to the touched test file relative to the prior ClawSweeper-reviewed head, so the earlier clean functional conclusion remains applicable. (src/tui/tui-pty-local.e2e.test.ts:1, b6516c2e6d89)
  • Area provenance: Recent history attributes both the shared real Gateway/PTy fixture and its queued-turn stabilization to Peter Steinberger, making steipete the strongest routing candidate. (src/tui/tui-pty-local.e2e.test.ts:667, dfb13780435f)
  • Main and release status: The PR head is not an ancestor of current main or the latest release commit, so this test repair is neither merged nor shipped. (b6516c2e6d89)

Likely related people:

  • steipete: Recent merged work created the shared real Gateway/PTy fixture and stabilized its queued-turn admission; the current branch continues that same test surface. (role: recent area contributor; confidence: high; commits: 2923ee40c48e, dfb13780435f; files: src/tui/tui-pty-local.e2e.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-03T17:42:51.415Z sha 38f9088 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 3, 2026
@steipete
steipete merged commit 5a65c96 into main Aug 3, 2026
121 of 123 checks passed
@steipete
steipete deleted the codex/qa0803-tui-pty-scenario-model-routing branch August 3, 2026 18:43
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
…-state-mutation

* origin/main: (22 commits)
  fix(delivery): renew stable producer leases (#118663)
  test(mcp): isolate catalog size checks from wall-clock load (#118871)
  test(ui): add credentials primary QA proof (#118790)
  fix(slack): prevent stalled presence polling from hanging shutdown (#117478)
  test(security): cover gateway shared auth modes (#118834)
  fix(macos): show gateway auth failures in app status (#118841)
  test(tui): route PTY gateway scenarios through explicit models (#118802)
  test(qa): add session transcript primary coverage (#118820)
  fix(browser): protect private observation media and Canvas trust boundaries (#118775)
  fix(build): restore SDK packages and signed macOS app builds (#118833)
  test(qa): cover plugin authoring contracts (#118821)
  fix(parallels): keep provider keys out of POSIX job logs (#118840)
  improve: reduce redundant Code Mode test work (#118815)
  fix(models): report primary OpenRouter limits in scans (#110855)
  test: speed up setup inference fixtures (#118811)
  fix(auto-reply): enforce canonical reset authorization (#118580)
  docs(gateway): fix invalid heartbeat visibility examples (#118827)
  fix(plugins): unify HTTP route conflict handling (#118203)
  test(agents): use prepared auth fixtures (#118816)
  fix(lmstudio): resolve JIT embedding variants
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant