Skip to content

fix(test): synchronize post-login catalog observations - #148107

Merged
obviyus merged 1 commit into
mainfrom
bugloop/models-auth-catalog-test-timing
Sep 14, 2026
Merged

obviyus merged 1 commit into
mainfrom
bugloop/models-auth-catalog-test-timing

Conversation

@obviyus

@obviyus obviyus commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Login catalog tests can fail while automatic discovery is working correctly.

Why This Change Was Made

Wait for the automatic HTTP request, hold its response through early reads, then confirm the published account row through passive models.list. This state has one writer: the fixture. This extends #147228 and preserves coverage for #145190. The fixed final-observation deadline is removed; the seven-second endpoint delay, read-latency limit, and 120-second test timeout remain.

User Impact

No production behavior changes.

Evidence

Failures: 34761804381, 34799773048, 34817608735.

node scripts/run-vitest.mjs src/gateway/server-methods/models-auth-login.catalog.integration.test.ts: reversing the automatic discovery calls from #145190 fails both cases; twenty corrected runs pass. Local lint, types, protocol and guards pass.

Both hosted cases pass on merge e847ce8327cf, combining main 43d413bd3938 with head f100a3fc2efb. Both credential-refresh tests pass with this patch on main 7066d660a6fd; they already observe request receipt or acknowledged publication.

Compatibility

No public contract changes.

Consumers

Only the login catalog test changes. The separate client-stop timeout remains outside this repair: no evidence links its socket-close failure to this observation race.

Invalidation

Request receipt and catalog publication drive observations; cleanup removes listeners.

Tests

Both endpoint delays and all passive-read and manual-refresh checks remain. Both held early responses must report pending; exactly one automatic request is required.

@clawsweeper

clawsweeper Bot commented Sep 14, 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.

@obviyus
obviyus marked this pull request as ready for review September 14, 2026 08:47
@obviyus
obviyus requested a review from a team as a code owner September 14, 2026 08:47
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@obviyus

obviyus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 148107
head: f100a3f
scope: owner-review

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 5:31 AM ET / 09:31 UTC.

ClawSweeper review

What this changes

Synchronizes the post-login model catalog integration test with HTTP request receipt and catalog publication while retaining delayed-discovery, passive-read, and manual-refresh checks.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused test repair: current main still uses timing-based observations, and no introduced correctness defect was found. The protected maintainer label also excludes automatic closure.

Priority: P3
Reviewed head: f100a3fc2efb8d441fd0185abd772978cacc4678

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused synchronization repair preserves meaningful coverage, reuses a production observation contract, and has verified exact-head hosted success.
Proof confidence 🌊 off-meta tidepool Not applicable: The host identifies this as maintainer-authored, and no production or authority behavior changes. The registered Gateway/local HTTP fixture exercises the relevant flow; exact-head hosted success is verified, while raw log inspection was blocked by the review environment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The host identifies this as maintainer-authored, and no production or authority behavior changes. The registered Gateway/local HTTP fixture exercises the relevant flow; exact-head hosted success is verified, while raw log inspection was blocked by the review environment.
Evidence reviewed 7 items Introduced synchronization and preserved assertions: The complete test holds the automatic HTTP response through early reads, registers the publication listener before releasing it, checks the account row through models.list, and removes listeners in finally. Both endpoint delays, latency checks, and manual-refresh coverage remain.
Existing production publication contract: Catalog publication updates the readable catalog before reporting publication; the listener API already serves Gateway chat metadata and is not a new test-only production seam.
Still necessary on fetched main: Direct inspection of the test at fetched main shows the one-second early observation and ten-second polling deadline still present. The latest supplied release tag has no entry for this test.
Findings None None.
Security None None.

How this fits together

After login, the Gateway discovers account-specific models and publishes them to its model catalog. This integration test exercises login and model-list requests against a local HTTP provider fixture.

flowchart LR
  A[Login wizard] --> B[Gateway account discovery]
  B --> C[HTTP provider fixture]
  C --> D[Held discovery response]
  D --> E[Catalog publication]
  E --> F[Passive model list reads]
  F --> G[Test assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +21. Total +21 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Keep fixture-controlled observation ordering while checking externally observable catalog results through the registered Gateway requests.

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

Yes at the source level: current main samples asynchronous discovery using elapsed-time deadlines, allowing scheduler delays to invalidate observations. The reported hosted failures were not independently reproduced in this read-only review.

Is this the best way to solve the issue?

Yes. The fixture controls response timing, the existing publication event provides synchronization, and assertions still inspect Gateway results without adding production hooks or increasing the overall test timeout.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This improves integration-test reliability without changing production behavior or public contracts.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The host identifies this as maintainer-authored, and no production or authority behavior changes. The registered Gateway/local HTTP fixture exercises the relevant flow; exact-head hosted success is verified, while raw log inspection was blocked by the review environment.

Label justifications:

  • P3: This improves integration-test reliability without changing production behavior or public contracts.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The host identifies this as maintainer-authored, and no production or authority behavior changes. The registered Gateway/local HTTP fixture exercises the relevant flow; exact-head hosted success is verified, while raw log inspection was blocked by the review environment.

Evidence

What I checked:

  • Introduced synchronization and preserved assertions: The complete test holds the automatic HTTP response through early reads, registers the publication listener before releasing it, checks the account row through models.list, and removes listeners in finally. Both endpoint delays, latency checks, and manual-refresh coverage remain. (src/gateway/server-methods/models-auth-login.catalog.integration.test.ts:182, f100a3fc2efb)
  • Existing production publication contract: Catalog publication updates the readable catalog before reporting publication; the listener API already serves Gateway chat metadata and is not a new test-only production seam. (src/agents/prepared-model-runtime.publication-events.ts:88, f100a3fc2efb)
  • Still necessary on fetched main: Direct inspection of the test at fetched main shows the one-second early observation and ten-second polling deadline still present. The latest supplied release tag has no entry for this test. (src/gateway/server-methods/models-auth-login.catalog.integration.test.ts:180, a08cdc50bc04)
  • Related merged feature: GitHub verifies fix(models): discover account models after sign-in #145190 merged on September 12. It supplies the account-discovery behavior tested here; it does not supersede this synchronization repair. (3d7d21166f09)
  • Focused hosted validation: GitHub confirms the linked Node test job succeeded on the exact reviewed head. The captured PR body reports both cases passing, twenty corrected local runs, and both cases failing when automatic discovery was reversed. The job-log download redirected to a host blocked by the review environment, so raw traces were not independently inspected. (f100a3fc2efb)
  • Area history and routing: Main history identifies Ayaan Zaidi's account-discovery work and Peter Steinberger's subsequent test synchronization work. GitHub maps the latter commit to steipete and confirms its changes to the retained refresh fixture. Local blame could not complete because an older blob was unavailable; no introduction claim relies on that failed blame. (src/gateway/server-methods/models-auth-login.catalog.integration.test.ts:35, f9de0362f7a9)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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.

@obviyus
obviyus merged commit 464f199 into main Sep 14, 2026
176 checks passed
@obviyus
obviyus deleted the bugloop/models-auth-catalog-test-timing branch September 14, 2026 10:45
@obviyus

obviyus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @obviyus!

Proof: Both login cases pass in hosted CI and across 20 local runs. Removing automatic discovery still fails both cases.

  • Bug: Catalog tests could fail when automatic discovery crossed a timed observation.
  • Fix: The fixture waits for request receipt and published account rows before checking passive reads.
Before After
Correct background discovery could fail a timing-based check. Request and publication events order the checks; all product assertions remain.

roboclaw-bot added a commit to VACInc/openclaw that referenced this pull request Sep 14, 2026
Main now owns the request/publication synchronization repair in 464f199 (openclaw#148107). Remove the duplicate PR-side test change to resolve the overlap; the six-file capture repair is unchanged.

Co-authored-by: VACInc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
## What Problem This Solves
Login catalog tests can fail while automatic discovery is working correctly.

## Why This Change Was Made
Wait for the automatic HTTP request, hold its response through early reads, then confirm the published account row through passive `models.list`. This state has one writer: the fixture. This extends openclaw#147228 and preserves coverage for openclaw#145190. The fixed final-observation deadline is removed; the seven-second endpoint delay, read-latency limit, and 120-second test timeout remain.

## User Impact
No production behavior changes.

## Evidence
Failures: [34761804381](https://github.com/openclaw/openclaw/actions/runs/34761804381), [34799773048](https://github.com/openclaw/openclaw/actions/runs/34799773048), [34817608735](https://github.com/openclaw/openclaw/actions/runs/34817608735).

`node scripts/run-vitest.mjs src/gateway/server-methods/models-auth-login.catalog.integration.test.ts`: reversing the automatic discovery calls from openclaw#145190 fails both cases; twenty corrected runs pass. Local lint, types, protocol and guards pass.

Both hosted cases [pass](https://github.com/openclaw/openclaw/actions/runs/34824551516/job/103914012589) on merge `e847ce8327cf`, combining main `37c97a239f5f` with head `f100a3fc2efb`. Both credential-refresh tests pass with this patch on main `1077e0c609e6`; they already observe request receipt or acknowledged publication.

## Compatibility
No public contract changes.

## Consumers
Only the login catalog test changes. The separate client-stop timeout remains outside this repair: no evidence links its socket-close failure to this observation race.

## Invalidation
Request receipt and catalog publication drive observations; cleanup removes listeners.

## Tests
Both endpoint delays and all passive-read and manual-refresh checks remain. Both held early responses must report pending; exactly one automatic request is required.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Sep 15, 2026
)

## What Problem This Solves
Multiline `/steer` and `/tell` messages lose later lines when incoming command text still contains newlines. A command-only first line returns usage. Closes #146007.

## Why This Change Was Made
Extend the existing argument-preservation policy from goal to steer. Normalized command text has one writer. Match whitespace consistently in the reset reader so a configured `/steer` trigger still resets with newline or tab separators; authorization and anchored payload extraction stay unchanged.

Production: `commands-registry-normalize.ts` +7/-2; `session-reset-command.ts` +2/-1. Tests: `commands-steer.test.ts` +17; `session.test.ts` +39. No new owner or configuration key.
Growth accepted under the owner's standing acceptance (2026-09-15).

## User Impact
Complete instructions reach the active run or normal idle fallback. Configured reset commands keep resetting the conversation with the complete payload.

## Evidence
Raw WebChat `chat.send` reproduced truncation on main `3869ac66de02`. Retained real-Gateway recordings at `26d6274c2d67` passed three active-run and three idle cases with a deterministic provider. Each active case was matched to the original held task, and its complete current instruction was inspected at the provider boundary. Empty usage stayed correct. The Control UI's local steering shortcut removes the command prefix and is a separate path.

The reset regression fails on `26d6274c2d67` for newline and tab delimiters, then passes with this correction. The non-boundary `/steering` case keeps the existing conversation. These tests call `initSessionState` with seeded state and check the reset revision and complete payload.

## Compatibility
No configuration, schema, dependency, or API shape change. Group mention processing and some adapters flatten newlines before normalization; that separate formatting issue is outside this change. Per-channel scope comes from source inspection unless a runtime capture is cited.

## Consumers
Shared text-command callers with newline-preserving ingress, plus configured reset detection during admission and session initialization.

## Invalidation
No cache lifecycle change.

## Tests
The three steering regressions exercise the real command-context builder and registered handler; the retained Gateway proof establishes delivery beyond that boundary. The pinned merge includes main `3869ac66de02`, where 79 focused tests passed before this correction. All 259 tests passed across session initialization, steering, and reset-model suites. After correcting two fixture typing errors, the three seeded-session cases passed again on `d86aebfa4701`. The existing session test file is selected once by the hosted test command.

Historical CI failures have retained timing/compiler-launch evidence and passing focused checks with upstream repairs #148107 and #146491. Historical base/parent reruns and full current hosted CI are not claimed.

| Before | After |
| --- | --- |
| ![Before](https://github.com/user-attachments/assets/0474c4a2-1f19-4be8-b644-68db0c01a0e8) | ![After](https://github.com/user-attachments/assets/0aa13924-364d-4af5-9484-497b2cb9cbd0) |

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…claw#146009)

## What Problem This Solves
Multiline `/steer` and `/tell` messages lose later lines when incoming command text still contains newlines. A command-only first line returns usage. Closes openclaw#146007.

## Why This Change Was Made
Extend the existing argument-preservation policy from goal to steer. Normalized command text has one writer. Match whitespace consistently in the reset reader so a configured `/steer` trigger still resets with newline or tab separators; authorization and anchored payload extraction stay unchanged.

Production: `commands-registry-normalize.ts` +7/-2; `session-reset-command.ts` +2/-1. Tests: `commands-steer.test.ts` +17; `session.test.ts` +39. No new owner or configuration key.
Growth accepted under the owner's standing acceptance (2026-09-15).

## User Impact
Complete instructions reach the active run or normal idle fallback. Configured reset commands keep resetting the conversation with the complete payload.

## Evidence
Raw WebChat `chat.send` reproduced truncation on main `0da26ff6b4cc`. Retained real-Gateway recordings at `26d6274c2d67` passed three active-run and three idle cases with a deterministic provider. Each active case was matched to the original held task, and its complete current instruction was inspected at the provider boundary. Empty usage stayed correct. The Control UI's local steering shortcut removes the command prefix and is a separate path.

The reset regression fails on `26d6274c2d67` for newline and tab delimiters, then passes with this correction. The non-boundary `/steering` case keeps the existing conversation. These tests call `initSessionState` with seeded state and check the reset revision and complete payload.

## Compatibility
No configuration, schema, dependency, or API shape change. Group mention processing and some adapters flatten newlines before normalization; that separate formatting issue is outside this change. Per-channel scope comes from source inspection unless a runtime capture is cited.

## Consumers
Shared text-command callers with newline-preserving ingress, plus configured reset detection during admission and session initialization.

## Invalidation
No cache lifecycle change.

## Tests
The three steering regressions exercise the real command-context builder and registered handler; the retained Gateway proof establishes delivery beyond that boundary. The pinned merge includes main `0da26ff6b4cc`, where 79 focused tests passed before this correction. All 259 tests passed across session initialization, steering, and reset-model suites. After correcting two fixture typing errors, the three seeded-session cases passed again on `d86aebfa4701`. The existing session test file is selected once by the hosted test command.

Historical CI failures have retained timing/compiler-launch evidence and passing focused checks with upstream repairs openclaw#148107 and openclaw#146491. Historical base/parent reruns and full current hosted CI are not claimed.

| Before | After |
| --- | --- |
| ![Before](https://github.com/user-attachments/assets/0474c4a2-1f19-4be8-b644-68db0c01a0e8) | ![After](https://github.com/user-attachments/assets/0aa13924-364d-4af5-9484-497b2cb9cbd0) |

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

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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