Skip to content

fix(ui): gateway logs truncate complete persisted messages - #117666

Merged
steipete merged 1 commit into
mainfrom
codex/qa400-ui-logs-persisted-message-c614
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa400-ui-logs-persisted-message-c614

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users viewing Gateway Logs in the Control UI would see only the first positional log fragment when a persisted record already contains the complete flattened message.

Why This Change Was Made

The logger already produces the authoritative, complete top-level message. The Control UI now reads that canonical field before positional fragments while retaining the existing positional-only fallback for older records and preserving subsystem, timestamp, level, and ANSI handling.

User Impact

Operators now see complete gateway diagnostics in the Logs dashboard, including trailing context that previously disappeared. Existing older log records continue to display normally.

Evidence

  • Regression-first proof against unchanged production: 2 failing, 4 passing; both failures showed request failed instead of request failed retry later.
  • Focused regression suite after the fix: 6 passing across subsystem records, generic positional records, older positional-only records, timestamps, levels, and ANSI handling.
  • Command: OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/pages/logs/data.test.ts.
  • Four independent hostile source-only reviews: CLEAN (google, ws_reconnect_events, agents_lifecycle, feishu_delivery).
  • Official structured autoreview: gpt-5.6-sol, high reasoning, P0–P3, zero findings, confidence 0.99; native TruffleHog 3.96.0 clean.
  • Reviewed immutable commit: c614538e46448ae736ea9e2330bcd62e125425f8; two files; production delta +8/-8 (net zero).
  • AI-assisted implementation and review; no logging, redaction, transport, or credential-handling behavior changed.
  • Real served Control UI Logs dashboard proof on the exact frozen head c614538e46448ae736ea9e2330bcd62e125425f8: 1/1 passed using actual Google Chrome 150.0.7871.187, the real Vite-served Logs page, and a mocked Gateway WebSocket serving canonical persisted JSONL via the actual logs.tail request.
  • Persisted canonical multi-part log record exercised through the real UI: {"0":"{\"subsystem\":\"gateway\"}","1":"request failed","2":"retry later","message":"request failed retry later","time":"2026-08-01T15:00:00.000Z","_meta":{"logLevelName":"ERROR"}}. The actual visible Logs row preserved the entire authoritative message as request failed retry later; a generic multi-part worker record preserved artifact conversion failed retry tomorrow, and an unchanged positional-only legacy record remained visible.
  • Actual dashboard search for retry later returned exactly the full visible message request failed retry later, proving the previously lost trailing context is both rendered and searchable; time, level, and subsystem columns remained intact, with no Gateway or unknown-agent error.
  • Focused browser command: PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/qa400-logs-fidelity-proof.e2e.test.ts (the isolated temporary proof spec was removed after the run; the frozen reviewed tree remained unchanged).
  • Genuine redacted dashboard screenshots: logs-complete-persisted-messages.png and logs-searches-preserved-trailing-context.png under /private/tmp/openclaw-qa400-logs-fidelity-c614-browser-artifacts/; structured persisted-record/rendered-row/search evidence is in logs-fidelity-proof.json in the same directory.
  • Authoritative clean exact-head browser-test terminal log: /private/tmp/openclaw-qa400-logs-fidelity-c614-browser-proof.log (Test Files 1 passed; Tests 1 passed; duration 16.18s).

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 1, 2026
@steipete
steipete marked this pull request as ready for review August 1, 2026 22:29
@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 Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 9:57 PM ET / August 2, 2026, 01:57 UTC.

ClawSweeper review

What this changes

The PR updates the Control UI Logs parser to display a persisted log record’s complete canonical message before older positional fragments, with regression tests for modern and legacy records.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

The patch is a focused, source-backed repair: current main parses raw gateway-log lines through the Control UI parser, which selects positional fragments before the persisted complete message. The PR reverses that precedence, retains the legacy positional fallback, adds targeted coverage, and has credible served-UI proof; it remains open only for the protected maintainer-label human merge decision.

Priority: P2
Reviewed head: c614538e46448ae736ea9e2330bcd62e125425f8
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow, well-covered parser repair with direct UI behavior proof and no actionable correctness or security finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body documents an exact-head served Control UI proof that rendered and searched the full persisted message through the real Logs page, and the supplied check context includes successful real-behavior proof runs.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body documents an exact-head served Control UI proof that rendered and searched the full persisted message through the real Logs page, and the supplied check context includes successful real-behavior proof runs.
Evidence reviewed 7 items Current-main failure path: The Logs page requests logs.tail, filters returned strings, and maps every line through parseLogLine, so parser precedence directly controls the displayed and searchable message.
Current-main defect: Current main checks positional fields "1", "2", and "0" before obj.message; a persisted multi-part record therefore loses trailing message fragments whenever positional fields are present.
Logger ownership contract: The subsystem logger supplies the complete message as the logger call’s message argument while metadata is passed separately, supporting the PR’s use of the persisted top-level message as the authoritative display value.
Findings None None.
Security None None.

How this fits together

The Gateway returns bounded raw log lines through logs.tail, and the Control UI converts each line into a structured row for filtering and display. This change sits at that UI parsing boundary and affects the diagnostic text operators see and search in the Logs dashboard.

flowchart LR
  A[Gateway log file] --> B[Gateway logs.tail response]
  B --> C[Control UI log refresh]
  C --> D[Structured log parser]
  D --> E[Canonical message selection]
  E --> F[Searchable Logs dashboard]
Loading

Decision needed

Question Recommendation
Should a maintainer approve the exact-head merge of this focused Control UI log-fidelity fix despite the protected maintainer label? Approve the focused repair: Merge after confirming the current three-way result still contains the message-precedence change and focused regression coverage.

Why: The source, tests, successful checks, and real UI proof support the repair, but the repository policy reserves protected-label handling for explicit human judgment.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; GitHub reports it cleanly mergeable, but the approving maintainer should assess the resulting merge state rather than relying on the older branch snapshot alone.
  • Complete next step (P2) - No mechanical repair remains; the protected maintainer label requires a human to approve or defer the merge after checking the final merge result.
Agent review details

Security

None.

PR surface

Source 0, Tests +49. Total +49 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 8 0
Tests 1 49 0 +49
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 57 8 +49

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: ui/src/pages/logs/data.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the canonical top-level-message precedence with the legacy positional fallback, then merge the clean final result after maintainer approval.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the canonical top-level-message precedence with the legacy positional fallback, then merge the clean final result after maintainer approval.

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

Yes. A current-main logs.tail payload containing positional fragments and a complete top-level message deterministically reaches parseLogLine, whose present precedence returns only the first positional fragment.

Is this the best way to solve the issue?

Yes. Preferring the logger-produced canonical message at the UI parsing boundary fixes the owner of the display defect while preserving the existing positional-only fallback for older records.

AGENTS.md: found and applied where relevant.

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

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:

  • P2: This is a bounded Control UI diagnostic-fidelity bug that can hide trailing gateway context without affecting message delivery or runtime availability.
  • 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 (live_output): The PR body documents an exact-head served Control UI proof that rendered and searched the full persisted message through the real Logs page, and the supplied check context includes successful real-behavior proof runs.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents an exact-head served Control UI proof that rendered and searched the full persisted message through the real Logs page, and the supplied check context includes successful real-behavior proof runs.

Evidence

What I checked:

  • Current-main failure path: The Logs page requests logs.tail, filters returned strings, and maps every line through parseLogLine, so parser precedence directly controls the displayed and searchable message. (ui/src/pages/logs/logs-page.ts:93, 5dca33a8fb67)
  • Current-main defect: Current main checks positional fields "1", "2", and "0" before obj.message; a persisted multi-part record therefore loses trailing message fragments whenever positional fields are present. (ui/src/pages/logs/log-lines.ts:77, 5dca33a8fb67)
  • Logger ownership contract: The subsystem logger supplies the complete message as the logger call’s message argument while metadata is passed separately, supporting the PR’s use of the persisted top-level message as the authoritative display value. (src/logging/subsystem.ts:346, 5dca33a8fb67)
  • Proposed canonical repair: The PR changes only message precedence: it selects a string obj.message first and keeps the existing positional-field and raw-line fallbacks intact. (ui/src/pages/logs/log-lines.ts:77, c614538e4644)
  • Regression coverage: The PR adds cases for subsystem and generic multi-part persisted records plus a positional-only legacy record, asserting message, subsystem, timestamp, and level behavior. (ui/src/pages/logs/data.test.ts:7, c614538e4644)
  • Feature provenance: The current parser and its initial focused tests were introduced by Peter Steinberger in the merged current-main commit, making the same area’s history and intended parsing boundary traceable. (ui/src/pages/logs/log-lines.ts:50, 3772f0754b50)

Likely related people:

  • steipete: Current main attributes the parser implementation to Peter Steinberger, and the PR author also created the narrow follow-up repair on the same path. (role: feature introducer and recent area contributor; confidence: high; commits: 3772f0754b50, c614538e4644; files: ui/src/pages/logs/log-lines.ts, ui/src/pages/logs/data.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 (2 earlier review cycles)
  • reviewed 2026-08-01T22:34:39.462Z sha c614538 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T01:53:00.860Z sha c614538 :: needs maintainer review before merge. :: none

@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 2, 2026
@steipete
steipete merged commit c879606 into main Aug 2, 2026
164 of 182 checks passed
@steipete
steipete deleted the codex/qa400-ui-logs-persisted-message-c614 branch August 2, 2026 02:15
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
llwijvbw123 pushed a commit to llwijvbw123/openclaw that referenced this pull request Aug 28, 2026
…elf-release

* commit '10a390ed7fa88d09da0d4523c3ed1e3550ece5c6': (4646 commits)
  fix(release): allow larger npm plugin artifacts (openclaw#117745)
  refactor(macos): consolidate gateway process fixtures (openclaw#117740)
  fix(ui): preserve complete persisted log messages (openclaw#117666)
  fix(ui): decode artifact previews as UTF-8 (openclaw#117657)
  fix(control-ui): restore sandbox media previews (openclaw#117689)
  fix(plugins): link host declared as direct dependency (openclaw#117738)
  fix(macos): avoid self-named defaults suite (openclaw#117690)
  fix(inference): preserve run ownership and completion delivery (openclaw#117731)
  test(talk): align browser E2E tool completion
  test: consolidate OpenClaw E2E fixtures (openclaw#117701)
  fix(release): ignore bundle fields in npm locks (openclaw#117730)
  fix(meeting-bot): keep configured host options internal
  refactor(line): remove dead card helpers (openclaw#117729)
  perf(cli): attribute command startup stages (openclaw#117720)
  refactor(whatsapp): deduplicate reply delivery test fixtures (openclaw#117710)
  docs(changelog): note bounded WebRTC tool calls
  docs(changelog): note meeting audio bounds
  fix(meeting-bot): preserve node host SDK surface
  test(talk): split WebRTC tool lifecycle coverage
  fix(meeting-bot): break node host import cycle
  ...

# Conflicts:
#	package.json
#	src/agents/model-auth.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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