Skip to content

test(logging): isolate prefix cases from cached inode - #173376

Merged
Patrick-Erichsen merged 1 commit into
mainfrom
fix-log-tail-prefix-fixture
Oct 15, 2026
Merged

Patrick-Erichsen merged 1 commit into
mainfrom
fix-log-tail-prefix-fixture

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A new log-tail cursor cache assumes append-or-rotate log files. The existing prefix test overwrote the same inode between independent cases, so the second case reused stale cached state and failed on current main. Each case now uses its own log file. This is a standalone main-CI repair; no Claw or Lobster files are changed.

Evidence

  • Before, clean main 8958e91f5e0: the focused test failed at src/gateway/server.logs-tail.test.ts:231 (expected ["following value"], received ["…redacted…"]).
  • After: pnpm test src/gateway/server.logs-tail.test.ts --maxWorkers=1 passed 6/6.
  • pnpm exec oxfmt --check src/gateway/server.logs-tail.test.ts and git diff --check passed.

@clawsweeper

clawsweeper Bot commented Oct 15, 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 the gateway Gateway runtime label Oct 15, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper autofix

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

@clawsweeper autofix is retired; ClawSweeper now only reviews.

@Patrick-Erichsen
Patrick-Erichsen enabled auto-merge (squash) October 15, 2026 18:23
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR gives independent log-tail prefix test cases separate temporary log files.

Example: The inherited-prefix case follows the non-inherited case and reads “following value”.

  • Before: Reusing the same file can carry cached redaction state into the second case and return “…redacted…”.
  • After: A fresh file makes the second case independently return “following value”.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported; validation consists of reported integration-harness results rather than independently inspected execution output.
Proof confidence 🦐 gold shrimp (3/6) Only test setup changes; the author reports a failing baseline and passing focused Gateway RPC suite, and no shipped behavior requires separate live proof.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Gateway test runs fail because independent prefix scenarios reuse cached state from the same rewritten file.
Reason: The change repairs fixture isolation without weakening assertions, modifying production behavior, or reversing an accepted performance tradeoff.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a concrete fixture failure while preserving the accepted cache contract and every redaction assertion; no introduced defect was found.

Priority: P3
Reviewed head: 92d7fc82f98f41bc3bec1238e2ae76be480adcf3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway logs.tail RPC reads the configured log file through the shared tail reader, which carries redaction context between cursor polls and returns masked lines with byte cursors.

flowchart LR
  A[Prefix fixtures] --> B[Temporary log files]
  A --> C[Gateway logs.tail RPC]
  C --> D[Configured tail reader]
  B --> D
  D --> E[Redaction anchor]
  D --> F[Masked lines and cursor]
Loading

Technical review

Best possible solution:

Land the isolated fixture repair after the repository’s required checks permit merging.

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

The shared-file loop and cache reuse condition establish the fixture failure path, corroborated by the author’s failing baseline report; no tests were executed during this read-only review.

Is this the best way to solve the issue?

Separate files are the appropriate small repair because the cases are independent and same-inode rewrites are explicitly outside the cache’s accepted contract.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1541902 adds src/logging/log-tail.ts:28 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1541902c5cad; files: src/logging/log-tail.ts)
  • Ayaan Zaidi: Raw commit fe3b289 adds src/gateway/server.logs-tail.test.ts:256 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fe3b2891fdea; files: src/gateway/server.logs-tail.test.ts)

PR surface

Tests +4. Total +4 across 1 file. Added test files: 0.

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

Labels

Label changes:

  • add P3: A narrow test-fixture repair restores useful coverage without changing shipped behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: A narrow test-fixture repair restores useful coverage without changing shipped behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 15, 2026, 2:31 PM ET / 18:31 UTC.

@Patrick-Erichsen
Patrick-Erichsen merged commit 40806cf into main Oct 15, 2026
114 of 117 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the fix-log-tail-prefix-fixture branch October 15, 2026 18:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
RomneyDa pushed a commit that referenced this pull request Oct 16, 2026
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
…law#173376)

(cherry picked from commit 40806cf)
(cherry picked from commit 34ac9b8)
Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 29, 2026
…ns in gateway lane FRV tests (#187589)

* fix(sessions): keep malformed rows out of the legacy transcript locator projection

The #181247 backport (08ee066) adapted the main change for the release
branch's legacy sessionFile locator by projecting json_extract(entry_json,
'$.sessionFile') on every selected row. SQLite raises 'malformed JSON' for an
unreadable entry_json before parseSessionEntryJson can apply its skip/reject
policy, so ordinary selected listings and gateway lookups failed with a raw
SQLite error. Project the locator only for transcript selections and only for
valid JSON rows. Release-only: main retired the sessionFile locator.

* test(logging): isolate log-tail prefix cases from cached inode (#173376)

(cherry picked from commit 40806cf)

* test(gateway): realign sessions_send owner continuation to the #181373 backport

9b8ee9c (#181373 backport) adopts timed sessions_send children into the
requester turn and changes the inline wait to waitForAgentRunReply. The backport
dropped a8a3680's matching fixture changes, so the test spied on the old
SessionFollowupCompletion.take and waited forever. Apply main's fixture hunk
(observe waitForAgentRunReply and registry persistence). The release branch has
no session-controller liveness check (#175837), so a claimed result is handed
back only by the requester run's settlement; the synthetic original run now
performs the settleRequesterRun call its embedded runner makes on completion.

Adapted from a8a3680

* test(agents): keep six-outcome settle fixture undelivered after consumed-cohort backport

The 2f7589a backport of #181260 filters delivered child findings from
settle wakes (needsRequesterSettleFindings). On main, #178104 moved the shared
makeSettledChild default to pending delivery; the release fixture still
defaults to delivered, so this case lost every finding. Mark its children
pending, as the backport did for its other undelivered fixtures.

* test(gateway): keep progress-only settle recovery undelivered after #181260 backport

Backport 2f7589a dropped the source commit's fixture change because
main had moved the recovery case into
server.subagent-settle-replay-recovery.test-support.ts. Apply the same
'progress only' pending-delivery setup to the inline release copy.

(adapted from commit 535989c)

* test(agents): keep private settle policy fixtures undelivered after #181260 backport

Backport 2f7589a filters delivered child findings from settle wakes.
On main, #178104 moved the shared fixture default to pending and renamed
these cases to pending pairs; the release fixture still defaults to
delivered, so the private marker was filtered. Mark the children pending.

* test(agents): mock retireRequesterFollowupAuthority in settle retry fixture

Backport 9b8ee9c (#181373) made execution cleanup call
retireRequesterFollowupAuthority. This release-only fixture mocks
requester-cron-authority.js without that export, so the retry wake threw
and warned. Main no longer has this mock.

* fix(subagents): keep queued collectors out of operator completion custody

The release adaptation 4643f86 of #181373 started capturing the
operator continuation context for every spawn so collectors also record
their original requester source. It dropped the collect guard on binding
completion authority, so a queued collector retained an operator source
hold after its parent completed or stopped. Main binds only non-collect
runs (authority && !registerParams.collect); restore that guard here and
keep completionAuthorityRequired aligned with it.

* test(agents): mark settle retry cron-authority mock as isolation

The added retireRequesterFollowupAuthority export changed the grandfathered
factory hash. Name the isolation reason and prune the stale baseline entry.

---------

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

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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