Skip to content

fix(gateway): recover session previews past long hidden transcript tails - #178512

Closed
HeZ2z wants to merge 8 commits into
openclaw:mainfrom
HeZ2z:pr-127630-transcript-preview-tail
Closed

HeZ2z wants to merge 8 commits into
openclaw:mainfrom
HeZ2z:pr-127630-transcript-preview-tail

Conversation

@HeZ2z

@HeZ2z HeZ2z commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Part of #127630

AI-assisted: yes. Authored by an AI coding agent; every check below executed against this checkout.

What Problem This Solves

session.preview/Talk show an empty preview when a short visible history sits behind a long tool-only (non-projectable) transcript tail. On current main the readers already read bounded tail pages (64 events / 1 MiB, then 1024 / 8 MiB) instead of materializing the whole transcript — but the recovery page stopped at 1,024 events, so a visible history behind a longer toolResult tail exhausted the window, the projection produced no items, and sessions-read published status: "empty". The same widening loop was duplicated in three places.

This PR adds the final ceiling-sized window and stops widening when the previous page was limited by bytes rather than events, so a byte-capped recovery page no longer re-reads the same 8 MiB tail.

User Impact

Session previews and Talk model context recover the newest visible messages instead of showing an empty preview (or reading unbounded history) for sessions with long tool-only tails. Short histories and small limits behave exactly as before.

Why This Change Was Made

  • New src/gateway/session-transcript-preview-bounds.ts owns one bounded widening policy with explicit SESSION_PREVIEW_SCAN_MAX_EVENTS = 2048 and SESSION_PREVIEW_SCAN_MAX_BYTES = 8 MiB ceilings: a small page, a recovery page, and a final ceiling-sized page, stopped early when the requested count is reached or no older events remain.
  • The shared policy also stops before a window that cannot make progress: if the previous page selected fewer events than its event cap, the byte budget stopped it, and a next window with the same byte budget would repeat the same tail.
  • The exact selected-row count comes from the bounded active-context hydration result (selectedEventCount, excluding the session header and injected boundary events) and is carried to Talk through an internal bounded-selection record. Every bounded hydration producer reports it: SQLite, actor-backed incognito history, and the empty-memory snapshot. SessionManager.onTruncated stays () => void, so this adds no public SDK callback surface. Display and incognito readers report their selected-event counts directly.
  • The display preview reader, Talk model-context reader, and incognito in-memory history path all use the shared policy instead of three copies of the old 1,024-event loop.
  • Projection stays on the bounded page (buildSessionPreviewItems); output shape and ordering are unchanged; the sync reader handles display/incognito, the async reader handles Talk.
  • The new module is listed in scripts/pr-lib/wrapper-components.txt, so the trusted-anchor PR wrapper inventory stays closed over runtime imports.

Evidence

Regression tests prove the base/fixed split (64 visible rows + 1,500 toolResult rows, limit 12):

base reader (1,024-event recovery): status "empty", items []
fixed: newest 12 visible rows (visible 52-63)
Talk model context, limit 16: base [] / fixed newest 16
incognito memory preview: base [] / fixed newest 12
incognito model context (actor-backed hydration), limit 16: base [] / fixed newest 16
byte-capped recovery: stops after [64, 1024] windows instead of repeating 8 MiB
byte-capped Talk page (header + 1,023 selected rows): windows [64, 1024];
  a header-inclusive count regresses to [64, 1024, 2048]
hidden tail beyond the ceiling: [64, 1024, 2048] windows, no unbounded scan

Local checks on head f80d0b291:

node scripts/run-vitest.mjs run src/config/sessions/session-actor-transcript-replica.test.ts
  -> 1 file, 16 tests passed (typed Bounded fixture now reports selectedEventCount: 2)

node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.agents-sessions.json --noEmit --incremental false
  -> passed

git diff --check -> clean

The removed helper-only session-transcript-preview-bounds.test.ts window-count cases are covered by the production reader regressions in server.sessions.preview-resolve.test.ts (explicit tail scan ceiling, and Talk byte-cap stopping) and session-transcript-readers.memory.test.ts / session-actor-memory-history.test.ts (incognito recovery).

Real behavior proof

1. Display preview (sessions.preview RPC)

Isolated state dir, 64 visible assistant rows + 1,500 toolResult rows seeded through the session accessor, local Gateway started from the repo CLI entry with gateway.mode=local and auth none, then the public RPC:

$ node --import ./scripts/tsx.mjs src/entry.ts gateway call sessions.preview \
    --params '{"keys":["main"],"limit":12,"maxChars":120}' --port 39481 --json
{
  "previews": [{
    "key": "main",
    "status": "ok",
    "items": [
      { "role": "assistant", "text": "visible 52" },
      ...
      { "role": "assistant", "text": "visible 63" }
    ]
  }]
}

2. Shipped Talk entry point (talk.client.create RPC)

Tested through an isolated Gateway on an ephemeral port with an isolated voice provider registered (createBrowserSession). Both scenarios executed end-to-end through openclaw gateway call talk.client.create:

Scenario 1: Byte-capped stopping (durable session)
64 visible assistant rows behind a 5 MiB row and 1,023 ~4 KiB rows (exceeding the 8 MiB page budget before event limit). The 8 MiB recovery page is byte-limited below its 1,024-event cap, so the policy stops early instead of repeatedly re-reading the 8 MiB tail; 0 items produced for Talk context:

$ openclaw gateway call talk.client.create --port 39485 --params '{"sessionKey":"agent:main:byte-capped"}' --json
[gateway] [talk.client.create -> createBrowserSession] initialItems count: 0
[gateway] [talk.client.create -> createBrowserSession] initialItems sample: []
[gateway] [ws] ⇄ res ✓ talk.client.create bytes=259
{
  "provider": "test-talk",
  "transport": "webrtc",
  "clientSecret": "proof-ephemeral-secret",
  "model": "test-model",
  "voice": "alloy",
  "voiceSessionId": "<uuid>"
}

Scenario 2: Hidden-tail visible history recovery (durable session)
64 visible assistant rows behind 1,500 toolResult rows (exceeding the old 1,024-event cap). The recovery policy widens through the 2,048-event ceiling window and recovers the newest 16 visible items into Talk context:

$ openclaw gateway call talk.client.create --port 39485 --params '{"sessionKey":"agent:main:hidden-tail"}' --json
[gateway] [talk.client.create -> createBrowserSession] initialItems count: 16
[gateway] [talk.client.create -> createBrowserSession] initialItems sample: [
  {"role":"assistant","text":"visible 48"},
  {"role":"assistant","text":"visible 49"},
  {"role":"assistant","text":"visible 50"}
]
[gateway] [ws] ⇄ res ✓ talk.client.create bytes=259
{
  "provider": "test-talk",
  "transport": "webrtc",
  "clientSecret": "proof-ephemeral-secret",
  "model": "test-model",
  "voice": "alloy",
  "voiceSessionId": "<uuid>"
}

In-memory incognito recovery through readTalkRealtimeInitialItems on the shipped session-actor storage binding (64 visible assistant rows + 1,500 toolResult rows):

caller: readTalkRealtimeInitialItems (invoked by talk.client.create)
scenario: 64 visible + 1500 toolResults; limit=16 items / 8,000 bytes
count=16
items=[{"role":"assistant","text":"visible 48"}, ...,
       {"role":"assistant","text":"visible 63"}]

CI note. check-test-types passes on this head (the typed Bounded fixture fix). checks-node-changed is red on test/gateway-openai-compaction-replay.e2e.test.ts:102 ("Continue from the compacted transcript" split length 2 vs 3). The identical failure is present at every head that ran that job (301269dec, 6005d42a9, 89de4013f, f80d0b291), the failing test is not modified by this PR, and its retry path (src/agents/embedded-agent-runner/run/terminal-resolution.ts) is untouched by this diff; the last behavior change there is #178192, merged before this branch's base. Main pushes skip the node CI jobs (verified: node checks are skipped on recent main check runs), so a same-job main comparison is not available; the repo's own test:ci-failed classifier reports [unknown] No matching job on main for this job. The failure is deterministic across heads, so a retrigger is not expected to change it. Treat this check as inherited/unattributed, not caused by this change.

Residual risk / boundary. A tail longer than the 2,048-event / 8 MiB scan still yields empty with no truthful truncation field — surfacing truncation needs a preview result-shape change and is deliberately out of scope here. Byte-heavy tails can stop at the 8 MiB page budget below 2,048 events, and the policy now stops there rather than re-reading the same tail. Oversized single rows remain omitted by the existing SQLite reader; filters needing history older than the ceiling cannot recover. The linked issue's remaining truthful-truncation contract is why this PR is Part of rather than closing it.

@clawsweeper

clawsweeper Bot commented Oct 20, 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 gateway Gateway runtime size: M labels Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR shares bounded preview recovery across display, Talk, and incognito readers and adds a final 2,048-event window.

Example: A session contains 64 visible assistant messages followed by 1,500 tool-result messages; sessions.preview requests 12 items.

  • Before: The 1,024-event recovery window returns status empty.
  • After: The final bounded window returns visible 52 through visible 63 in order.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The bounded repair is useful and supported by shipped-RPC evidence; redundant coverage adds avoidable cost, and the linked issue is only partially addressed.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Contributor terminal and live-output evidence exercises the changed readers through isolated Gateway sessions.preview and talk.client.create RPCs, recovering visible history behind 1,500 hidden rows and covering byte-limited Talk context; incognito evidence separately exercises the shipped actor binding.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Session previews appear empty and Talk loses visible context when recent tool-result rows hide otherwise available messages.
Reason: Recovering existing visible history is established behavior with demonstrated user value; the linked issue's exhaustion-reporting contract remains explicitly outside this repair.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a current preview-recovery bug with credible shipped-entry-point evidence and no identified production correctness blocker; redundant tests should be trimmed, and current-head CI remains pending.

Priority: P2
Reviewed head: f5a6a0fd5268f166dd319bc476d818c18e9cb5b3

Before merge

None.

Findings

None.

Tests

  • Low-value test src/gateway/server.sessions.preview-resolve.test.ts: Remove the added discovery-visibility test at line 298 and spawnedBy test at line 409: equivalent cases already run at lines 80 and 176 in this file.
  • Low-value test src/gateway/server.sessions.preview-resolve.test.ts: Remove the added short preview-budget and 320-tool-row cases: the retained combined preview regression already covers formatting and ordinary recovery, while the new 1,500-row cases cover the distinct failure.
Agent review details

How this fits together

Gateway preview and Talk requests select transcript history from SQLite workers or memory actors, project visible messages, and return bounded preview items.

flowchart TD
A[Preview or Talk request] --> B[Shared widening policy]
B --> C[SQLite display reader]
B --> D[SessionManager hydration]
B --> E[Memory actor preview]
C --> F[Message projection]
D --> F
E --> F
F --> G[Bounded preview items]
Loading

Technical review

Best possible solution:

Retain the shared bounded recovery repair while leaving truthful scan-exhaustion reporting to the linked issue.

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

Current-main source deterministically excludes visible history behind 1,500 tool-result rows for ordinary preview limits; contributor Gateway traces establish the before/after behavior, and no target code was executed during this review.

Is this the best way to solve the issue?

The shared policy is a focused repair that preserves existing storage and projection owners, uses exact selected-row counts to stop byte-limited rereads, and avoids changing public callbacks or persisted formats.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +100, Tests +448, Other +4. Total +552 across 18 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 10 185 85 +100
Tests 4 449 1 +448
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 4 0 +4
Total 18 638 86 +552

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression growth Production +185/-85 lines; tests +449/-1 lines. Shared recovery and exact selection facts justify production growth, but repeated resolver and preview cases inflate the regression allocation.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Long hidden transcript tails can produce empty previews and omit Talk context, with limited impact and a bounded repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove repeated preview and resolver tests while retaining the distinct hidden-tail, scan-ceiling, byte-budget, and backend regressions.

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.

History

Review history (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-11-04T12:38:06.115Z sha 4bc64c13508794892889d12c8f0bc0eaeb311c2d :: needs changes before merge. :: none
  • reviewed 2026-11-04T13:29:10.825Z sha a9d7101d8cd02e6106927cf02bcf2542b1942c28 :: needs changes before merge. :: none
  • reviewed 2026-11-05T10:39:30.282Z sha 1493fab :: needs changes before merge. :: [P1] [P1] Import the bounded-selection recorder before calling it | [P2] [P2] Budget the necessary regression growth
  • reviewed 2026-11-05T10:54:56.093Z sha 4cde828 :: needs changes before merge. :: [P2] Budget the necessary regression growth
  • reviewed 2026-11-05T11:19:51.876Z sha c612963 :: needs changes before merge. :: [P2] Remove the unused Node imports from the preview test | [P2] Remove the obsolete truncation variable and callback
  • reviewed 2026-11-05T11:30:39.163Z sha ee3ae3c :: needs changes before merge. :: [P2] Remove the unused Node imports from the preview test
  • reviewed 2026-11-05T12:19:23.930Z sha 7d59547 :: needs changes before merge. :: [P2] Reduce the allocation to the remaining test-line growth
  • reviewed 2026-11-05T12:44:19.728Z sha 4352f92 :: needs maintainer review before merge. :: none

Reviewed November 5, 2026, 7:56 AM ET / 12:56 UTC (Revision 18).

@HeZ2z

HeZ2z commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 20, 2026
@HeZ2z

HeZ2z commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — new head 301269dec carries the exact selected-row count through an internal bounded-selection record (no public callback change) and adds the byte-capped Talk regression.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@HeZ2z

HeZ2z commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — current head 4bc64c13 is rebased onto fresh upstream/main and its CI is green (all check-runs success; the ci-gate aggregate is still reporting PENDING, no failures). It also adds the missing selectedEventCount to the perf clone measure, which the earlier test-typecheck shard flagged. Please review this head.

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 4, 2026
@HeZ2z

HeZ2z commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — merge conflicts resolved: the branch is rebased onto current upstream/main, main's own filtered-tool-row test is kept as the baseline, and the hidden-tail recovery / scan-ceiling / Talk model-context cases are reattached on top sharing the harness helper (no duplicate identifiedClient, no duplicate seedPreviewTranscript). Local run of the owning file: 13 passed / 0 failed. Perf clone measure keeps the selectedEventCount fix for the test-typecheck shard. Please review this head.

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Preview and Talk readers bounded their tail reads, but the recovery page
stopped at 1,024 events. A visible history behind a longer tool-only tail
therefore previewed as empty.

Share one bounded widening policy with explicit 2,048-event / 8 MiB scan
ceilings and a final ceiling-sized page, used by display previews, Talk
model context, and incognito memory reads.
@HeZ2z

HeZ2z commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — conflicts resolved. The branch is now a single commit on current upstream/main (7ec1d3e) and GitHub reports MERGEABLE.

Three files needed 3-way resolution because main changed underneath:

  • session-transcript-preview.ts — kept main's new withSessionTranscriptHydrationCaller wrapper and merged it with the bounded-selection read; also fixed the async callback to take the window object (({ maxEvents, maxBytes })) which was a real implicit-any error.
  • session-manager-reload.ts — took main's version (it no longer imports the bounded-selection recorder).
  • scripts/pr-lib/wrapper-components.txt — re-added only our one entry, keeping main's ordering.

Verified on a clean Ubuntu box against main: the change applies cleanly, and the owning test file plus the gateway-server/gateway-root/agents-sessions type shards show no diagnostics from our files (the remaining shard errors also occur on unpatched main in that environment). Please review this head.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

The reload path still calls recordSessionManagerBoundedSelection, so the
module import must stay; dropping it during the merge left the call
undefined at runtime.
@HeZ2z

HeZ2z commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — CI caught a real regression from my conflict resolution: session-manager-reload.ts still calls recordSessionManagerBoundedSelection but I had dropped its import, so the incognito memory reader threw ReferenceError: recordSessionManagerBoundedSelection is not defined. Fixed at head 4cde828 by restoring the import.

Locally re-ran all four test files the PR touches at this head: session-actor-memory-history + session-actor-transcript-replica 36 passed, session-transcript-readers.memory + server.sessions.preview-resolve 21 passed — 57/57 green.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

The recovery cases need real seeded transcripts (1,565 and 4,565 rows) to
prove the bounded widening, which is more test text than the ratchet
headroom allows.
@HeZ2z

HeZ2z commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — fixed the baseline-ratchet failure at head c612963.

Two real issues found and addressed:

  1. Test-lines ratchet — the new coverage adds 451 net test lines (the recovery cases need real seeded 1,565- and 4,565-row transcripts), which is over the ceiling. Added config/test-lines-allocations/preview-hidden-tail-recovery-127630.txt using the same justification format the repo already uses for such PRs.
  2. Runtime regression from my conflict resolution (previous head) — the reload path still calls recordSessionManagerBoundedSelection; restoring its import is committed.

Verified on a clean Ubuntu checkout of current main with this exact patch staged, running the repo's own ratchets:

max-lines ratchet OK: 398 grandfathered suppressions / OPENCLAW_* count 459/459
Line-cap ratchet OK: 15 changed source files; no new violations or over-cap growth
assertion SAFETY ratchet OK: 2384 files, 5413 grandfathered assertions
Test lines OK: 6486823; ceiling: 6486858; slack: 35
SQLite dialect ratchet OK / test timeout race ratchet OK

All four touched test files pass locally at this head (57/57).

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Main's hydration wrapper owns truncation now; the local flag was dead and
tripped the unused-variable check after the merge.
@HeZ2z

HeZ2z commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — head ee3ae3c fixes the remaining type/lint failure.

check-prod-types and check-test-types-core-* flagged session-transcript-preview.ts: 'truncated' is declared but its value is never read — a dead flag left over from merging main's new hydration wrapper (truncation now comes from readSessionManagerBoundedSelection). Removed it.

Verified on a clean Ubuntu checkout of current main with this patch applied:

  • run-tsgo -p tsconfig.core.json: no diagnostics in any file this PR touches (the remaining shard errors also occur on unpatched main in that environment — @openclaw/* package builds).
  • oxlint --tsconfig tsconfig.json on the new/changed gateway + agents sources: 0 warnings, 0 errors.
  • All repo ratchets previously verified green with the allocation in place.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

once, fs, and path came from the previous helper block; the merge keeps
main's harness helpers instead, so the imports are unused.
@HeZ2z

HeZ2z commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — head 7d59547 fixes the check-lint failures.

run-oxlint-shards --only=core reported three real findings, all mine:
no-unused-vars for once, fs, and path in server.sessions.preview-resolve.test.ts. Those imports came from the previous helper block; the merge keeps main's harness helpers instead, so they were dead. Removed.

Verified on the clean Ubuntu checkout with this patch applied: run-oxlint-shards --only=core now reports no no-unused-vars findings (the remaining max-lines entries also fire on unpatched main there). The owning test file still passes locally at this head: 13/13.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

HeZ2z added 2 commits November 5, 2026 20:27
Removing the unused imports dropped three test lines, so the allocation
must match exactly; an over-request fails the same ratchet.
The bounded active-context type now requires selectedEventCount; this perf
script builds that type and must report the same count.
@HeZ2z

HeZ2z commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — head 4352f92 clears the last two ratchet/type failures.

  1. checks-fast-baseline-ratchets — my test-lines allocation was over-sized: removing the unused imports dropped three test lines, so 451 became Test line allocation credit 451 exceeds added test lines 448. Sized it to exactly 448; the ratchet now reports Test lines OK: 6486820; ceiling: 6486855; slack: 35.
  2. check-test-types — the remaining diagnostic was scripts/perf/transcript-snapshot-copy-measure.ts(115,5): error TS2741: Property 'selectedEventCount' is missing. That script is new on main and builds the bounded active-context type that this PR makes require the count, so it needs the same one-line update the clone measure already got. Added (scripts/perf/transcript-snapshot-copy-measure.ts is otherwise byte-identical to main — verified by diffing against the main blob).

Verified on the clean Ubuntu checkout with this exact patch staged:

Test lines OK: 6486820; ceiling: 6486855; slack: 35
max-lines ratchet OK: 398 grandfathered suppressions
Line-cap ratchet OK: 15 changed source files; no new violations or over-cap growth
assertion SAFETY ratchet OK: 2384 files, 5413 grandfathered assertions
run-oxlint-shards --only=core: no no-unused-vars findings
run-tsgo -p tsconfig.scripts.json: no diagnostics in the perf measures

The remaining run-oxlint-shards max-lines entries also fire on unpatched main in that environment.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Place the bounded-selection import with its sibling module imports so the
format check stays green.
@HeZ2z

HeZ2z commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — head f5a6a0f fixes the last check-lint failure.

The log showed [check:changed] format changed files failing on src/agents/sessions/session-manager-reload.ts: I had appended the restored recordSessionManagerBoundedSelection import after session-manager-memory-read.js, breaking the sibling-import ordering. Moved it ahead of session-manager-incognito-scope.js.

oxfmt --check on that file now reports clean formatting, and the owning memory-readers test still passes locally at this head (8/8). All check-lint-core-* shards were already green in the same run; this was the only remaining item.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L 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