Skip to content

fix: resume interrupted tasks in their original session - #173579

Merged
steipete merged 6 commits into
mainfrom
steipete/team-resumehere
Oct 16, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/team-resumehere

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: a task interrupted by a Gateway restart can only continue in a replacement conversation after automatic recovery gives up.

User Impact

WebChat's Resume continues the saved task in the same session, preserving its identity, workspace, participants, children, and automation bindings. The click supplies current operator authority; it does not restore old approvals or replay completed tool calls. Retry exhaustion leaves the same actionable Resume path.

Resume in new session remains available when a CLI runtime cannot enforce required restart-safe tool restrictions. An already-linked replacement opens that existing session. Pending final delivery must settle first; a missing transcript requires repair.

Why This Change Was Made

The original replacement flow in #122644 (bb5ef9872a70) avoided resuming a native provider thread with a changed dynamic-tool catalog. The current native runtime can rotate an incompatible provider thread while preserving the OpenClaw session (extensions/codex/src/app-server/thread-lifecycle-run.ts:519). The recovery service's unconditional successor allocation is now limited to the replacement path (src/gateway/session-recovery-service.ts:427).

The recovery owner validates the session ID and recovery cycle, then uses ordinary chat admission. The existing input actor accepts the continuation and clears the tombstone in one SQLite transaction (src/config/sessions/session-pending-input-store.ts:282). No new schema, scheduler, or durable store is introduced. WebChat requests in-place recovery; omitting the new mode preserves the existing public API replacement contract. Existing unknown-outcome guidance and restart-safe tool policy follow the turn through dispatch and queues.

The pre-admission recovery-row guard ends after its own successful commit; current operator/source authority and normal admitted-input access checks remain (src/gateway/server-methods/sessions-recover.ts:60). Otherwise, clearing the tombstone invalidated the new turn before dispatch.

Related work reviewed: #172234 (presentation, merged), #165957 (session-controller draft), #166340 and #170336 (restart continuation). This is an adapter at today's recovery/chat owners, with no competing controller.

Evidence

The Team Gateway journal contains six delegated-sender-authority failures at lines 607774, 750589, 798599, 846511, 879013, and 916035. These are sanitized locations only; no message content or session identifiers are included.

Before:

Before: restart banner offers only Resume in new session

After:

After: restart banner offers Resume in the same session

Both captures use inspected synthetic sessions in the Control UI mock harness. The mock E2E also verifies the explicit second-click CLI fallback.

Real-process proof passed 4/4: ordinary permission-change control, managed restart, raw SIGTERM, and SIGKILL with a second restart during the resumed turn. Every restart case reaches final completion in the original session, clears the tombstone, preserves a durably cancelled task, blocks revoked/restricted effects, and checks that completed tool effects occur exactly once. The initial full matrix took 119.539 seconds of test time (605.22 seconds including build). After preserving the stored restriction ceiling, the managed and SIGTERM cases passed again (27.635 and 59.396 seconds); the synthetic provider now deliberately issues a stale execution call when tools are hidden and verifies its rejection. SIGKILL plus the second restart and ordinary permission-control cases also passed in the subsequent CI run. No test timeout was increased.

The probe exposed an existing live-permission bug on clean main (c3b63ff4c0ec5338d56a4109d2162889db49d653): an ordinary operator turn failed with “Permission change was not authorized by the current operator request.” run/attempt.ts awaited tool reconstruction before recording the authorized change, after its synchronous authorization scope ended. Recording the change before the await fixes the owner without extending authorization lifetime (src/agents/embedded-agent-runner/run/attempt.ts:423); successful acknowledgement still waits for reconstruction.

Focused validation
  • pnpm test test/gateway-session-resume-restart.e2e.test.ts --maxWorkers=1: 4 passed.
  • node scripts/run-vitest.mjs src/gateway/server.sessions.recover-in-place.test.ts --maxWorkers=1: 10 cases passed in the final focused run. Existing server.sessions.recover.test.ts: 23 passed.
  • Touched session/runtime/recovery suites: 237 passed. Recovery-state suite: 32 passed. Auto-reply suites: 72 passed. After merging main, the complete queue.authority.test.ts file passed all 17 cases, including cancellation handoff and both new restart-tool-restriction cases.
  • Focused UI suites: 25 passed. node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-restart-resume.e2e.test.ts: 2 passed.
  • Core/UI production, Gateway/messaging, UI-other and banner E2E test typechecks passed after the merge. The UI-chat graph has the clean-main failure recorded below. Typed lint, formatting and git diff --check passed.
  • The final actionable-notice assertion passed in the delivery suite; both changed test files passed targeted lint, formatting, and the root-test typecheck.
  • CI repair: extracted the shared authority input type to remove a type-only import cycle; check-madge-import-cycles reports zero cycles. Updated restart-message assertions and the remaining channel-feedback notice. Authority suites passed, sharing-state tests 9/9, model-lock session cases 3/3, delegated shutdown case 1/1, channel-notice suite 8/8. No timeout or safety assertion was weakened. The final Gateway suite passed all 10 cases, including persisted tool restrictions after a successful tool-result tail: restrictions reach native/embedded dispatch and block unsupported CLI continuation. A committed review found this missing retained restriction; the fix matches automatic recovery’s existing safety ceiling. PR review also identified omitted delivery constraints in the full-access exemption; the same automatic-recovery checks now keep media, disabled-message, and suppressed-text restrictions effective, with Gateway rejection proof for all three.
  • pnpm prompt:snapshots:gen, UI English/i18n verification, and pnpm docs:check-links: passed; 15,539 links checked, none broken.
  • Committed-branch Codex autoreview: scoped-clean, no actionable P0–P2 findings (including unchanged authority, input-actor, runtime-classification, and recovery-policy context).

Merged main bd18e16d7de2c4ffd8a2bdaf1b15533dcf094197, including its cancellation-handoff repair. The automatic merge preserves main’s aggregate cancellation owner and disposal unchanged; the only queue/drain.ts difference from main is propagation of forceRestartSafeTools and forceCodeModeTools. No manual conflict resolution or new production semantics were introduced.

Post-merge validation: queue authority 17/17, Gateway in-place admission 10/10, focused UI 25/25, banner E2E 2/2. Core/UI production and targeted Gateway/messaging, UI-other and banner E2E test typechecks passed; typed lint and formatting passed. The UI-chat graph fails at ui/src/pages/chat/chat-pane-model-catalog.test.ts:167 with TS2304: Cannot find name render. Running the same canonical graph on clean main bd18e16d7de2c4ffd8a2bdaf1b15533dcf094197 reproduces that exact failure; the file is unchanged by this PR. The compiler-inventory test also reproduces on clean main: test/scripts/tsgo-core-test-shards.test.ts still expects ui/src/components/agent-avatar-face.test.ts after its rename to .tsx, yielding expected [] to deeply equal [ui-components]. Neither failing file is changed by this PR. Final-head CI run 38837406620 completed on c25ebe8a0b86270bf0b8e9a6482d7a51056176ea. Its only failing test is the compiler-inventory assertion above (checks-node-compact-small-1); the aggregate gate is consequently red. The queue-authority failure did not recur, and there are no other failing jobs beyond the aggregate gate. No workflow was rerun.

Production: +851 / −389 lines (net +462); tests: +1452 / −42 (net +1410); docs: +25 / −8 (net +17). Most test growth is the real-process restart fixture and Gateway admission regression. Production growth adds the in-place recovery branch and carries existing tool restrictions through normal turn/queue owners. Existing source tracking and error presentation were split by responsibility to keep owner modules within their length limits.

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T01:55:40.637727Z c25ebe8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6923834ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/session-recovery-service.ts Outdated
Comment on lines +331 to +332
const fullAccess =
execPolicy.mode === "full" && execPolicy.security === "full" && execPolicy.ask === "off";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve retained delivery restrictions in full-access checks

When a tombstoned session has a retained delivery constraint such as restartRecoveryDeliveryMediaUrls, restartRecoveryDisableMessageTool, or restartRecoverySuppressTextDelivery, and its exec policy is full/full/off, this marks the resume as unrestricted. The automatic recovery owner explicitly excludes those states from fullAccess in main-session-restart-recovery-store.ts:498-504; omitting the same checks here can bypass restart-safe tools and the CLI fallback, allowing a full-access CLI continuation even though it cannot enforce the retained message/delivery restriction. Include the retained delivery constraints when computing fullAccess.

AGENTS.md reference: AGENTS.md:L71-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f2ec360. In-place recovery now applies the same three retained-delivery checks as automatic recovery before allowing the full-access exemption. Gateway regressions cover media, disabled-message, and suppressed-text constraints: all keep the CLI session tombstoned, preserve its transcript, and admit no input. The complete in-place Gateway suite passes 10/10.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR adds explicit recovery that continues interrupted work in its original session while retaining replacement-session recovery.

Example: A Gateway restart interrupts work in agent:main:operator-resume-continue.

  • Before: Resume creates a replacement conversation with a different session identity.
  • After: Resume continues in agent:main:operator-resume-continue under the current operator's authority.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful owner-directed recovery work, but retained restrictions can be lost and authority and released-state compatibility evidence remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Replacement recovery changes conversation identity and separates interrupted work from its existing participants, children, and bindings.
Reason: The maintainer-authored direction has clear user value and reuses existing owners; the historical replacement-only rationale is explicitly addressed.

Merge readiness

⛔ Blocked before merge - 8 items remain

Keep this maintainer-authored PR open: preserving the original session is useful, but two restart-safety regressions and stale CI assertions need repair.

Priority: P2
Reviewed head: c6923834ce68309e82ab6159a5f3cf8461827f15

Before merge

  • Add real behavior proof - Authority-chain proof required: the body reports real Gateway subprocess recovery with allowed filesystem effects and read-only permission-change controls, and inspected screenshots show the synthetic UI action; no supplied final-effect evidence shows that revoking the recovering operator's device or role after admission prevents I/O, including after another restart. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Exclude retained delivery constraints from unrestricted recovery (P1) - For a tombstoned session with full/full/off exec policy and retained delivery constraints, this computes fullAccess=true. Automatic recovery explicitly excludes restartRecoveryDeliveryMediaUrls, restartRecoveryDisableMessageTool, and restartRecoverySuppressTextDelivery from that classification. Here the classifier can return unrestricted recovery and skip the CLI fallback, exposing ordinary tools despite the retained recovery contract. Apply the same retained-constraint exclusions before classifying the continuation.
  • Retain the safe-tools flag when transcript classification relaxes it (P1) - With restartRecoveryForceSafeTools=true, non-full exec policy, and a transcript ending in an ordinary completed tool result, resolveMainSessionResumePolicy can return forceRestartSafeTools=false. Its flag argument only affects selected transcript branches. Automatic recovery preserves retainedSafeTools by ORing it into the result; this branch forwards only the classifier result and clears the durable flag through the settlement patch. The continuation therefore loses its retained restriction and a CLI continuation can bypass replacement fallback. Compute one effective restriction including the retained flag and use it for both CLI admission and dispatch.
  • Update existing assertions for the new recovery instructions (P2) - The changed instructions leave three exact-head suites failing: session.test.ts still requires 'Resume in new session', session-accessor.sqlite-entry-cache.types.test.ts requires the old 'Use /new or /reset' substring, and server-run-shutdown.recovery.test.ts counts the removed replacement notice. GitHub annotations confirm all three failures. Update those assertions to the new Resume contract while retaining their terminal-state and single-notice checks.
  • Resolve security concern: Fresh operator authority does not replace retained replay restrictions - The two recovery-policy findings cross the host's tool-execution boundary: permission to resume a task does not establish that an uncertain prior effect may be repeated through unrestricted tools.
  • Complete next step - Identify and resolve the import cycle reported by check-guards-architecture; available annotations do not identify its source, so attribution remains open.
  • Improve patch quality - Add final-effect proof that revoking the recovering operator's device or role after admission prevents tool I/O, including after a second restart.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Exclude retained delivery constraints from unrestricted recovery — src/gateway/session-recovery-service.ts:331-332
  • [P1] Retain the safe-tools flag when transcript classification relaxes it — src/gateway/session-recovery-service.ts:383-385
  • [P2] Update existing assertions for the new recovery instructions — src/config/sessions/session-work-start.ts:148-149
  • [high] Fresh operator authority does not replace retained replay restrictions — src/gateway/session-recovery-service.ts:383

Tests

  • Low-value test src/auto-reply/reply/followup-turn-execution.test.ts: Remove the newly added forwarding-only test: it asserts options passed to a mocked executor rather than an observable execution restriction.
  • Missing end-to-end proof: Supply final-effect evidence for operator device or role revocation after recovery admission, including retained work across another restart; baseline failure of the new recovery scenarios is not shown.
Agent review details

How this fits together

The recovery RPC validates the interrupted session, prepares a continuation, and sends it through ordinary chat admission; the existing input actor persists that input and clears the recovery tombstone atomically.

flowchart TD
  A[WebChat Resume] --> B[Recovery RPC]
  B --> C[Recovery policy and authority]
  C --> D[Chat admission]
  D --> E[Session input actor]
  E --> F[Agent runtime and tools]
Loading

Technical review

Best possible solution:

Continue through the existing recovery and input actors while preserving retained restart restrictions and the public replacement-recovery contract.

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

Source establishes both restriction-loss paths, and exact-head CI annotations establish the stale assertions; no target code was executed during this review.

Is this the best way to solve the issue?

Using ordinary chat admission and atomic input acceptance is a sound approach, but manual recovery must preserve the automatic recovery owner's retained restrictions.

Full review comments:

  • [P1] Exclude retained delivery constraints from unrestricted recovery — src/gateway/session-recovery-service.ts:331-332
    For a tombstoned session with full/full/off exec policy and retained delivery constraints, this computes fullAccess=true. Automatic recovery explicitly excludes restartRecoveryDeliveryMediaUrls, restartRecoveryDisableMessageTool, and restartRecoverySuppressTextDelivery from that classification. Here the classifier can return unrestricted recovery and skip the CLI fallback, exposing ordinary tools despite the retained recovery contract. Apply the same retained-constraint exclusions before classifying the continuation.
    Confidence: 0.99
  • [P1] Retain the safe-tools flag when transcript classification relaxes it — src/gateway/session-recovery-service.ts:383-385
    With restartRecoveryForceSafeTools=true, non-full exec policy, and a transcript ending in an ordinary completed tool result, resolveMainSessionResumePolicy can return forceRestartSafeTools=false. Its flag argument only affects selected transcript branches. Automatic recovery preserves retainedSafeTools by ORing it into the result; this branch forwards only the classifier result and clears the durable flag through the settlement patch. The continuation therefore loses its retained restriction and a CLI continuation can bypass replacement fallback. Compute one effective restriction including the retained flag and use it for both CLI admission and dispatch.
    Confidence: 0.99
  • [P2] Update existing assertions for the new recovery instructions — src/config/sessions/session-work-start.ts:148-149
    The changed instructions leave three exact-head suites failing: session.test.ts still requires 'Resume in new session', session-accessor.sqlite-entry-cache.types.test.ts requires the old 'Use /new or /reset' substring, and server-run-shutdown.recovery.test.ts counts the removed replacement notice. GitHub annotations confirm all three failures. Update those assertions to the new Resume contract while retaining their terminal-state and single-notice checks.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Explicit recovery and WebChat recovery action changes intended behavior with a stated reason (bb5ef98: Replacement recovery isolated the new continuation from incompatible native-thread dynamic tools; this PR cites existing thread rotation and retains the legacy API path.)
  • Recovery worker and publication ownership keeps the original intent (d35e7d4: Keep SQLite recovery off the Gateway event loop while retaining source, caller, placement, and publication checks.)
  • Pending-input lifecycle admission keeps the original intent (f8ea55f: Select lifecycle expectations inside actor FIFO admission and retain them through version rebasing; the new branch uses that actor for atomic acceptance and tombstone settlement.)
  • Live permission application changes intended behavior with a stated reason (67433ff: Apply authorized permission changes to the exact active run and acknowledge after tool reconstruction; recording before the await preserves the synchronous authorization scope.)

Testing

Proof path: shipped entry point.

Security

Needs attention: Manual recovery can widen the host-retained restart tool policy before execution.

Evidence

Security concerns:

  • [high] Fresh operator authority does not replace retained replay restrictions — src/gateway/session-recovery-service.ts:383
    The two recovery-policy findings cross the host's tool-execution boundary: permission to resume a task does not establish that an uncertain prior effect may be repeated through unrestricted tools.
    Confidence: 0.99

What I checked:

  • Current main still allocates a replacement: Fetched main proceeds from tombstone validation to successor allocation; the introduced diff adds the in-place branch. The central behavior is not implemented on that main revision. (src/gateway/session-recovery-service.ts:335, 44998b0afc07)
  • Verified delivery-restriction mismatch: Manual recovery defines fullAccess from exec policy alone, whereas automatic recovery also excludes retained media, disabled-message-tool, and suppressed-text states. This independently confirms the existing Codex discussion at fix: resume interrupted tasks in their original session #173579 (comment). (src/gateway/session-recovery-service.ts:331, c6923834ce68)
  • Retained safe-tools flag can be discarded: The transcript classifier can return forceRestartSafeTools=false for an ordinary user or completed tool-result tail even when its input flag is true. Automatic recovery ORs the retained flag back into its result; the new manual branch does not. (src/agents/main-session-recovery/main-session-restart-recovery-store.ts:641, c6923834ce68)
  • CI failures attributable to changed recovery copy: Exact-head annotations identify obsolete assertions in session.test.ts, session-accessor.sqlite-entry-cache.types.test.ts, and server-run-shutdown.recovery.test.ts. Their expected replacement-session wording conflicts directly with the introduced Resume wording. (src/config/sessions/session-work-start.ts:148, c6923834ce68)
  • Remaining CI attribution limits: The architecture annotation reports madge-import-cycles without naming the cycle. Job-log retrieval redirected to a blocked Azure host, so that failure remains unclassified. The queue-revocation assertion matches the author's recorded clean-main reproduction and is not established as introduced here. (c6923834ce68)
  • Proof inspected: Downloaded before/after screenshots show the replacement action changing to Resume in a synthetic UI harness. The added subprocess fixture uses real Gateway RPCs and filesystem effects with a synthetic HTTP provider; the body reports four passing scenarios. The other two downloaded images belong to the earlier presentation change and do not prove this PR's backend recovery. (test/gateway-session-resume-restart.e2e.test.ts:427, c6923834ce68)

Likely related people:

  • Peter Steinberger: Raw commit f8ea55f adds src/config/sessions/session-pending-input-store.ts:362 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f8ea55fcf7a8; files: src/config/sessions/session-pending-input-store.ts)
  • Josh Lehman: Raw commit bb5ef98 adds src/gateway/session-recovery-service.ts:115 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bb5ef9872a70; files: src/gateway/session-recovery-service.ts)

PR surface

Source +451, Tests +1385, Docs +17. Total +1853 across 60 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 45 787 336 +451
Tests 13 1416 31 +1385
Docs 2 25 8 +17
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 60 2228 375 +1853

Review metrics

Metric Value Why it matters
Protocol additions 3 optional recovery parameters and 1 session-row field Adds mode, sessionId, recoveryCycleId, and restartRecoveryCycleId; omitting mode retains replacement recovery.

Labels

Label changes:

  • add P2: Same-session recovery is a useful workflow improvement with an existing replacement-session alternative.
  • add merge-risk: 🚨 compatibility: Recovery changes durable input acceptance and adds protocol fields; released-state upgrade compatibility remains unproven.
  • add merge-risk: 🚨 message-delivery: Retained delivery constraints are omitted from the unrestricted-recovery decision.
  • add merge-risk: 🚨 security-boundary: The new branch can discard retained tool restrictions before continuation execution.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦐 gold shrimp and patch quality is 🧂 unranked krab.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: Same-session recovery is a useful workflow improvement with an existing replacement-session alternative.
  • merge-risk: 🚨 security-boundary: The new branch can discard retained tool restrictions before continuation execution.
  • merge-risk: 🚨 message-delivery: Retained delivery constraints are omitted from the unrestricted-recovery decision.
  • merge-risk: 🚨 compatibility: Recovery changes durable input acceptance and adds protocol fields; released-state upgrade compatibility remains unproven.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦐 gold shrimp and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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, 8:28 PM ET / October 16, 2026, 00:28 UTC.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: c25ebe8a0b86270bf0b8e9a6482d7a51056176ea
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/harness/tool-authority.runtime.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2ec360d41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +137 to +138
forceRestartSafeTools: turn.opts?.forceRestartSafeTools,
forceCodeModeTools: turn.opts?.forceCodeModeTools,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prevent CLI fallbacks from dropping restart-safe restrictions

Even with the retained-delivery fullAccess check now fixed, when an embedded in-place continuation requires restart-safe or Code Mode tools and a later model fallback resolves to a CLI backend, these flags reach the shared candidate object but runCliFallbackCandidate does not enforce them. The CLI attempt can therefore execute its ordinary side-effecting tools despite the recovery restriction; reject CLI candidates while either flag is set or add an exact CLI enforcement contract.

AGENTS.md reference: src/agents/AGENTS.md:L23-L25

Useful? React with 👍 / 👎.

Comment on lines +200 to +203
params.mode === "in-place" &&
(params.sessionId !== initialSource.sessionId ||
params.recoveryCycleId !== initialSource.mainRestartRecovery?.cycleId ||
!initialSource.mainRestartRecovery?.tombstone)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fence replacement fallback to the advertised recovery cycle

When another client replaces the session key and that replacement enters a new recovery cycle before a stale CLI-fallback click reaches the Gateway, the UI still sends its captured sessionId and recoveryCycleId with mode: "new-session", but this guard ignores both. The stale request can consequently archive and continue the newer interrupted task; validate supplied identities for replacement mode too while preserving identity-free legacy calls.

AGENTS.md reference: src/gateway/AGENTS.md:L22-L25

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdadca2ed3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +350 to +351
const forceRestartSafeTools =
retainedSafeTools || policy.action === "complete" || policy.forceRestartSafeTools;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Settle completed recovery without starting another turn

When resolveMainSessionResumePolicy returns action: "complete" for a delivered-terminal receipt or a handled-silent turn, this code merely enables restart-safe tools and proceeds to launch another model continuation. That re-executes a task the recovery evidence already proves complete, potentially producing a duplicate reply; for CLI sessions it can even route the user toward creating a replacement session. The automatic recovery path in main-session-restart-recovery-store.ts handles the same policy by calling markSessionCompletedAfterRecoveryCheckpoint without dispatching model work, so in-place recovery should use that completion path instead.

Useful? React with 👍 / 👎.

@steipete

Copy link
Copy Markdown
Contributor Author

Landing review for head bdadca2ed396330ae39ec9c67f67248f651d6675 is complete. The operator authorized the native inherited-only CI exception for run 38833001839, attempt 1.

The only failed test is src/auto-reply/reply/queue.authority.test.ts > followup queue authority > keeps original grant revocation effective after collect retires an older client cancel (expected [false, true], observed [true, true]); openclaw/ci-gate fails downstream. The lead reproduced this on unmodified main d76b29e1529d. Retained earlier proof also reproduces the same assertion on c3b63ff4c0ec5338d56a4109d2162889db49d653 (14 passed, 1 failed).

CI checked out merge 163b0b15deba5e9272dc254de5430951fb60361d, whose parents are baseline 172aae503c51cd624223a41eaff06b234175afda and the reviewed PR head. The aggregate-cancellation function is identical across that baseline, the earlier reproduction baseline, the PR head, and the tested merge. The containing file does have two unrelated recovery-tool flag forwarding additions, which remain disclosed in native evidence. The failed result is retained as failed; no CI rerun or branch rewrite is being used to obtain green.

The lead's same-session restart, fresh-authority, retained-restriction, Gateway admission, UI, and synthetic screenshot proof is accepted. Native policy, security, enforced-review, and exact-head checks remain mandatory for this landing attempt.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c25ebe8a0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

sessionId: initialSource.sessionId,
sessionEntry: initialSource,
},
{ mode: "recent", maxMessages: 20, maxBytes: 256 * 1024 },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve full-turn replay-safe checkpoints on manual resume

When an interrupted Code Mode turn has more than 20 recent messages, its replay-safe checkpoint can fall outside this bounded read. Unlike automatic recovery, which also calls readMainSessionRecoveryCheckpoint because the display tail can evict that evidence, this path derives retainedSafeTools only from the row and recent messages; under full access it can therefore omit Code Mode controls or continue with unrestricted tools. Read the transcript checkpoint summary and fold its replay-safe fact into the resume policy as the automatic owner does.

AGENTS.md reference: AGENTS.md:L50-L53

Useful? React with 👍 / 👎.

@steipete

Copy link
Copy Markdown
Contributor Author

Landing this reviewed head (c25ebe8a0b86270bf0b8e9a6482d7a51056176ea) through the explicitly authorized native inherited-only CI exception.

CI run 38837406620, attempt 1 has one failing test job: checks-node-compact-small-1. Its test/scripts/tsgo-core-test-shards.test.ts inventory assertion still expects ui/src/components/agent-avatar-face.test.ts after the main-branch rename to .tsx. The lead reproduced the same assertion on unmodified main bd18e16d7de2c4ffd8a2bdaf1b15533dcf094197. The assertion, compiler-config helpers, config directory, and avatar directory are unchanged between that baseline, the actual CI baseline 56c315156f4542f197a2b7f727681ba3f41c21b5, and the tested merge 62d021747b1f7c1c76b76b3f8215c62ca365d223. openclaw/ci-gate is red only as the downstream aggregate.

The native evidence binds the exact failed attempt and tested merge, retained checkout/failure logs, unchanged source inputs, and the lead's scoped restart, Gateway, queue, and UI proof. Required review, security, and writer-authority checks remain enforced. This exception does not claim that CI passed, and does not change or rewrite the PR branch.

@steipete
steipete merged commit bfbfae7 into main Oct 16, 2026
174 of 178 checks passed
@steipete
steipete deleted the steipete/team-resumehere branch October 16, 2026 02:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

steipete added a commit that referenced this pull request Oct 16, 2026
The in-place resume refactor (#173579) moved returned-outcome handling
into the formatter module, leaving formatReturnedAgentErrors exported
with only a local caller. Keep the formatter private without changing
its aggregation behavior.

Retain SessionInputLifecycleAdmission and use explicit type-only imports
for its three real production consumers, which Knip missed in inline
import types. No Knip ignores or runtime behavior changes.

Proof: production and full-tree export scans clear the assigned findings;
scripts exports remain zero. Core types, targeted lint/format, the three
selected returned-error cases, and isolated P2 review pass. Other export
findings reproduce on the unmodified baseline; local unused-file findings
are six ignored Mermaid build outputs. The UI wrapper findings were
already removed by #173638.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
)

* fix(sessions): resume interrupted tasks in place

* fix(sessions): align resume guidance and authority type imports

* fix(sessions): retain restart safety through operator resume

* fix(sessions): preserve retained recovery delivery constraints

* test(sessions): verify restricted resume and actionable recovery notice
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
The in-place resume refactor (openclaw#173579) moved returned-outcome handling
into the formatter module, leaving formatReturnedAgentErrors exported
with only a local caller. Keep the formatter private without changing
its aggregation behavior.

Retain SessionInputLifecycleAdmission and use explicit type-only imports
for its three real production consumers, which Knip missed in inline
import types. No Knip ignores or runtime behavior changes.

Proof: production and full-tree export scans clear the assigned findings;
scripts exports remain zero. Core types, targeted lint/format, the three
selected returned-error cases, and isolated P2 review pass. Other export
findings reproduce on the unmodified baseline; local unused-file findings
are six ignored Mermaid build outputs. The UI wrapper findings were
already removed by openclaw#173638.
@jonathanlindsay

Copy link
Copy Markdown
Contributor

Thanks for #173579. Its description notes that it also fixed, on main, a live-permission bug: run/attempt.ts recorded the authorized change only after awaiting tool reconstruction, once the synchronous authorization scope had ended, and the fix records it before the await.

That fix is not on release/2026.10.10 (head 4205aca, 2026-10-20), nor in v2026.10.10-beta.1, v2026.10.10-beta.2 or v2026.10.5: src/agents/embedded-agent-runner/run/attempt.ts there still calls params.permissionChange?.recordApplied(mode) (line 437) after await preparedToolBase.refreshPermissionMode(...) (line 423), whereas main now records first (lines 427-428). The release branch and both betas branched at 459cad7 (2026-10-15), before #173579 merged (2026-10-16), and none of the open backport PRs to release/2026.10.10 touches this file.

On those builds every change to a running native-runtime reply fails, so the documented behaviour ("OpenClaw refreshes the active tool policy without restarting the conversation", docs/gateway/permission-modes.md, "Change permissions during a task") never happens:

  1. withAuthorizedPermissionChange sets authority.authorized and restores it in a finally as soon as the apply returns its promise (src/agents/embedded-agent-runner/run/permission-change.ts).
  2. The apply awaits refreshPermissionMode, which awaits constructTools, then calls recordApplied(mode), whose assertAuthorized now sees no authorization and throws "Permission change was not authorized by the current operator request."
  3. The run handle's catch calls abortRun, prepareSessionPatchPermissionChange calls change.stop(), logs Permission change failed: ..., and sessions.patch answers UNAVAILABLE: "Permissions were saved, but could not be applied to the active run. Stop the run and continue to use the saved permissions." In-flight tools were already aborted and run-bound approvals cancelled by refreshPermissionMode.

So the Control UI's Execution permissions picker, used during a reply, saves the mode, stops the reply, and shows "Failed to update permissions: GatewayRequestError: Permissions were saved, but could not be applied ..." every time.

Stock repro (no plugins)

Gateway on 2026.10.10-beta.1 with a scratch state dir, plugins.entries.bonjour.enabled: false, one agent on an openai-completions provider pointing at a local server that holds its streamed answer open:

  1. chat.send to agent:<id>:main; wait until the provider request arrives and sessions.describe reports hasActiveRun: true.
  2. sessions.patch { key, permissionMode: "guarded" } from an operator.admin connection.
  3. Observed: ok: false, UNAVAILABLE, the message above; the chat frame for the run ends aborted/error, not final; sessions.describe shows permissionMode: "guarded" (saved); the gateway log has Permission change failed: Permission change was not authorized by the current operator request.

Expected (per the docs page): the reply continues under the new mode with the permission-change notice.

Would you consider backporting the attempt.ts reorder (record before the await) to release/2026.10.10 before stable? It looks self-contained: one call moved above the await in run/attempt.ts, with no change to the authorization's lifetime.

steipete added a commit that referenced this pull request Oct 24, 2026
* test(ui): deslop q0178 tests

Remove the duplicate long-diff E2E layer: chat-session-diff-folding.real-gateway.e2e.test.ts covers the identical 64x680 fixture, unified/split rendering, and refresh collapse. session-diff-split.test.ts covers budget fallback and source preservation; chat-session-diff.e2e.test.ts covers deferred refresh.

Keep Mermaid touch, clipboard, and source-view expansion; markdown-mermaid-expansion.browser.test.ts owns click/keyboard activation and focus return. Remove success-only Mermaid/bootstrap media capture and compact the message fixture.

CI-only campaign: local oxlint, oxfmt, and diff checks passed; no tests or coverage run. Shard LOC 1310 to 1109 (15.3%); below the 40% target because remaining scenarios cover distinct behaviors.

* test(qa-lab): remove redundant q0174 product-proof layers

Port q0174 onto the campaign lane. The first source commit fb59ddd0922ae0e453987344a4b8be4d723ab551 is already present as 415487d52d22; apply the remaining cleanup from 43b21095aece1a8025b51228db60f96cc412344e without changing newer lane content.

Resolve the timing-map conflict by deleting only the inherited-policy entry, preserving the lane removal of the neighboring join-intro entry. Retain CLI SecretRef repair and exec gating, running-Gateway session cleanup, and manual worktree lifecycle proof; remove redundant product-proof layers.

Validation: oxlint and oxfmt --check passed on retained touched files; git diff --check and cached diff check passed. Independent read-only review found no actionable issues. Tests not run under the requested CI-only policy.

* test(ui): deslop q0180 tests

Remove duplicate RPC-envelope assertions and unasserted catalog screenshots. Use the shared page lifecycle for disk-space proof and one assertion helper for linked-session navigation before and after reload.

Remaining owner proof: browser-client.test.ts scopes only the session panel and sends transcript references only with its list; browser-panel-controller-input.test.ts captures a successfully navigated document when its tab snapshot fails; model-catalog-store.test.ts reuses pending catalogs until the native discovery owner invalidates them; chat-pane-model-catalog.test.ts revalidates the configured model catalog when the picker opens; cron-page.lifecycle.test.ts verifies configured agent-scoped model requests.

Preserve all 13 expanded cases: retry geometry/animation and text scale, export download/clipboard attribution, descendant network blocking through sandbox transitions, real response-body cancellation and error presentation, linked navigation identity/reload, dynamic reasoning/context convergence, accessible disk-pressure recovery, and retained/empty catalog warning isolation. These distinct browser behaviors prevent an honest 40% reduction. LOC 1054 -> 993 (-5.8%).

CI-only validation: plain oxlint exit 0, oxfmt and git diff --check passed. No tests, coverage, Testbox, typecheck, or build run.

* test(ui): remove redundant q0180 e2e layers

Delete chat-export-attribution and cron-agent-ownership E2E replays. Export transport/content remains covered by export.test.ts (readable download and speaker normalization), chat-send-submit.test.ts (local export commands), session-menu-navigation.test.ts (chronological transcript copy), and chat-message.forwarded-attribution.test.ts (never borrow viewer identity). Cron failure/empty recovery remains in cron-page.lifecycle.test.ts, draft preservation and event ordering in cron-page.catalog-notifications.test.ts, and catalog replacement/reopen in command-palette.test.ts. The palette model projection consumes models only, not catalog warning fields.

Retain browser screenshot authentication and visible failure, but remove Fetch instrumentation duplicated by browser-client.test.ts: rejects an unsuccessful screenshot without waiting for stream cancellation. Keep disk event-to-accessible-badge proof; chat-view.test.ts owns persistent disk guidance and recovery. Keep dynamic Chat convergence; new-session model-control tests own hydrated defaults/catalog rendering and metadata lifecycle. Drop request-count replays covered by chat-pane-model-catalog.test.ts and the catalog owner. Keep click and direct-link reload proof with colliding prefixes; the no-collision row takes the same full-UUID route branch.

Shrink only the deleted files entries in the private-server path list and E2E owner inventory. No production or helper changes. Original shard LOC 1054 -> 631 (-40.1%); this follow-up 993 -> 631. Eight expanded cases remain. CI-only: no tests, coverage, builds, or typechecks run. Plain oxlint exit 0, oxfmt, and git diff --check passed.

* test(ui): remove redundant q0172 lifecycle replays

Port q0172 from edd7ef1d27b7a9d29ba1340bbffb74c8f35eb854 and 0a4542847769cdc76fbcc911ec36bccf7ebfdaf5 onto the campaign lane. The first cleanup is already present; preserve it and all newer lane inventory changes while applying the remaining lifecycle replay removals and layout fixture cleanup.

Validation: plain oxlint, oxfmt --check, and git diff --check exited 0. Isolated review found no actionable issues. CI-only: no tests, coverage, Testbox, or check-changed were run.

* test(scripts): deslop q0177 tests

Reuse the existing HTTP fixture lifecycle in the installer proof and replace branching prefix fixture setup with explicit overrides. Preserve all installer, provenance, secret-handling, continuation, archive and prefix-stability contracts.

Drop the redundant explicit-true plugin fixture variant (default-enabled and disabled remain) and short-option budget replays (the retained long-option case reaches the same startsWith rejection). Keep budget-specific duplicate-option coverage.

CI-only campaign: formatting, diff-check and plain oxlint passed; tests and coverage deferred to hosted CI. The shard is already compact and the 40 percent LOC target was not achievable without dropping distinct boundary proof.

* test(scripts): consolidate q0177 owner-boundary proof

Remove the benchmark discovery lifecycle replay: src/gateway/server-discovery-runtime.test.ts owns starts registered local discovery services with gateway advertisement context and replaces advertisements and wide-area metadata across live mode and registry changes. Retain benchmark config and environment isolation here.

Keep formatted statistics and default plugin activation in test/scripts/bench-gateway-startup.test.ts, including requires seeded session access and clean shutdown only for populated fixtures and the teamBoot fixture assertions. Keep CI evidence emission in test/scripts/tsgo-core-test-shards.test.ts, including executes assigned root partitions serially through mixed CI and its transitive-consumer evidence cases.

Move runtime-log expectations into the saved-log CLI replay, consume the actual redaction result in notification proof, and assert timed report totals through the budget CLI. Share installer scenario orchestration and reuse the existing archive file builder without changing its public fixture interface.

CI-only: plain oxlint, oxfmt and diff-check passed. No tests or coverage run. Shard totals 1239 to 1087 lines; 40 percent remains unmet because the remaining independent security, platform, parser and lifecycle proof has no replacement.

* test(scripts): preserve installer failure propagation

Run the two POSIX installer subshells as standalone commands under set -e. The preceding consolidation put the healthy installer on the left side of &&, which can suppress errexit inside that subshell. Keep independent EXIT traps without changing the installer behavior under test. Static inspection only under the campaign CI-only instruction; no test runs.

* test(scripts): remove redundant q0177 metadata assertion

The retained real notify call reads the redaction-result file and requires a boolean notify_required before it can report the asserted skipped result. Remove the duplicate direct file assertion; preserve the notification-gating regression from 5a14b1c.

Re-audited PASS 15 moves 1-5: no stale subjects, source-grep inventories, or further safe whole-case deletions remain. Existing distinct security, provenance, runtime accounting, and compiler lifecycle cases block the 40 percent target. Formatting, plain oxlint and diff-check pass; no tests or coverage run under CI-only mode.

* test(scripts): deslop q0179 tests

Trim same-branch documentation and runtime-path variants. Keep the import-cycle and Kysely regressions from 906eb2d and 38784a3, plus the harness-runtime shutdown guard from 98813c2.

Use a direct oversized command in the transport fixture; pr-crabbox-gate-plan.test.ts owns canonical command construction and forwarding. Retain transport hash, exact-byte, oversized payload, tamper and child-join coverage. Remove unused auth fixture timestamps and share legacy-owner assertions across absent and pre-v7 shared databases.

CI-only campaign: plain oxlint, oxfmt and diff-check passed; no tests or coverage run. 1200 to 1172 shard lines; below the 40% target because remaining suites protect distinct release, auth, CI and lifecycle boundaries. No production changes.

* test(scripts): reduce q0179 fixture and assertion layers

Derive copied release closures from entry points and reuse publication-source paths; retain explicit frozen-workflow inputs. Minimize SQLite auth fixtures to the actual queried schema while preserving all schema-owner and view-rejection scenarios.

Remove repeated path and Kysely preparation variants, diagnostic wording/file-count assertions, workflow-step traces, and the transport builder replay. The retained oversized Linux payload, tamper and cleanup cases own transport behavior; pr-crabbox-gate-plan.test.ts owns command generation. The startup corpus tier case in ci-node-test-plan.test.ts owns canonical startup inclusion. Keep exact runtime inventory and changed timing-root assertions.

CI-only validation: plain oxlint exit 0, oxfmt and diff-check clean. No tests, coverage, builds or Testbox. Shard totals 1200 -> 993 lines (17.3%); 40% remains unmet rather than deleting distinct security, release or lifecycle proof. No production changes or files deleted.

* test(scripts): deslop q0181 tests

Consolidate iOS fixture ownership and package-fixture subprocess assertions. Remove Android routing restatements covered by ci-workflow-planning tests for native Access job and gate selection.

Remove the CLI transport source grep: invocation behavior remains covered by cli-invocation.test.ts, node-runtime-recovery.test.ts (preserves invocation and replacement exit), and respawn-child-runner.process.test.ts (real transport completion).

CI-only campaign: formatting, diff check, and plain oxlint pass. No tests or coverage run. Retain distinct signing, release selection/evidence, SDK removal, correlation ordering, and transition ownership cases; the shard cannot meet 40 percent without deleting their only proof.

* test(scripts): remove redundant q0181 proof layers

Drop workflow wiring and copied inventories while retaining permission, evidence allowlist, tooling pin, executable shell guard, and native report/APK validation contracts. Package ignore behavior is asserted through the staged Git tree.

Replace the preload-byte snapshot with existing executable coverage in src/process/respawn-child-runner.process.test.ts, src/infra/node-runtime-recovery.test.ts, and test/scripts/bun-standalone-support.test.ts. Consolidate iOS canonical selection into the real metadata-parser fixture. Retain followup transition cases instead of repeating the same accepted merge/rebase branches; keep all refusal cases.

CI-only validation: plain oxlint, oxfmt, and git diff --check passed. No tests or coverage run. This second pass remains below the 40 percent target because the remaining suites retain distinct owner branches and shared merge assertion support.

* test(scripts): consolidate q0181 driving fixtures

Share standalone manifest setup across projection and admission tests without dropping metadata branches. Keep the three signing-team decision paths in a compact table and remove same-path SwiftLint invalid-name input variants.

Read-only sibling audit confirms CLI manifest admission, package offline installation/relocation, and committed merge/rebase resolve-undo ownership have no equivalent replacement tests. Shared PR assertion helpers also have out-of-shard callers and cannot be deleted without breaking them. No subject in this shard is retired.

CI-only: oxfmt, plain oxlint and diff check passed; no tests or coverage run. Total remains below the requested 40 percent reduction rather than deleting uniquely covered behavior.

* test(ui): deslop q0182 tests

Reuse existing board and response fixtures and consolidate repeated model filtering setup. Keep every scenario and distinct assertion: the remaining split-face URL poll subsumes the substring check, strict visible person locators subsume duplicate count checks, and the retained error-state filter cycle covers provider filtering.

* test(scripts): deslop q0183 tests

Keep one curl failure per native installer: exit 28 and 56 both terminate at the same set -e boundary, with no status-specific branch. Retain timeout flags, pinned URLs, checksum rejection, and version checks.

Share worker stdout/stderr capture and reuse the existing module-membership predicate without dropping stream closure, bounded output, bundle isolation, or restore/export assertions. CI-only campaign: formatting, diff check, and plain oxlint pass; runtime proof is deferred to hosted CI. Shard lines 1363 -> 1346; distinct contracts prevent the requested 40% cut.

* test(scripts): consolidate q0183 proof layers

Retain emitted stream isolation from regression d57f91b while sharing owner assertions. The state-read-worker-stream fixture already asserts the selected emitted URL and ordered restore/export values; managed-child-process.drain and .output tests own process/pipe settlement. Retain managed command cleanup rather than reimplementing its observers here.

Keep one legacy-import scenario through recovery, retained blobs, and Git collection; generic immediate completion remains in pr-merge-outcome tests. Keep measured-large failure, empty-state equality, and explicit override budget branches. Drop duplicate tagged-reference input and process option restatements; keep inspection bounds and attestation rejection.

CI-only: plain oxlint, oxfmt, and diff check pass. No tests or coverage run. Shard 1363 -> 1275 lines, below 40 percent target; remaining proof covers distinct behavior, including security and regression boundaries.

* test(ui): deslop q0185 tests

Remove exact microphone-guidance replay covered by browser-talk-microphone-lifetime.e2e.test.ts, and numeric stepping/search dismissal replays covered by plugins-settings-keyboard.e2e.test.ts. Keep all consent decisions and whole-value schema branches.

Retire the mocked restart E2E layer: chat-pane-recovery.test.ts retains in-place recovery, rejected continuation, replacement navigation and draft preservation; chat-composer-disabled-banner.test.ts retains action dispatch and busy rendering. Both owner layers cover the original #173579 regression.

Keep sidebar keyboard, pushed-update and narrow viewport proof; session-hovercard.test.ts owns PR ordering/states/checks and session-progress-hovercard-target.test.ts owns pushed rate-limit notices. Keep tweet media, missing-preview and long-text paths; remove ordinary text rows already exercised by media and long-text cases.

Remove screenshot-only artifact generation and duplicate pagination failure diagnostics, preserving assertions and shared harness capture. CI-only campaign: no runtime or coverage runs. Static oxlint, oxfmt and diff checks pass. Test LOC 1120 -> 749 (33.1%); declarations 11 -> 7; expanded cases 25 -> 14. Below the 40% line target because remaining flows are distinct.

* test(media): deslop q0184 tests

Remove redundant media-understanding and fetch scenarios while retaining real CLI, proxy, channel lifecycle, SSRF, redirect and prepared music-provider integration proof.

Audio selection remains covered by src/media-understanding/attachments.guards.test.ts, apply.test.ts (preflight skips and last-preference transcript ordering), and audio-preflight.attachments.test.ts (configured selection and limits). Native vision handoff remains in runner.vision-skip.test.ts; current-turn-images.test.ts covers native bytes and described-image suppression.

Music fallback, unsupported controls and duration normalization remain in src/music-generation/runtime.test.ts. src/agents/tools/music-generate-tool.test.ts covers explicit deployment refs, ignored-override warnings and normalized-duration details. Keep prepared-provider invocation, audio persistence and invalid-format rejection here.

Both fetch overflow paths and empty-store cleanup remain in src/media/fetch.test.ts: cleans up streamed/content-length media overflow before a response clone is released. Remove the obsolete native-catalog mock baseline entry.

CI-only: no tests or coverage run. oxfmt, plain oxlint and git diff --check passed. Shard test lines: 1239 -> 1026 (17.2%); declarations: 12 -> 9. Below the 40% target because remaining transport, lifecycle and security compositions have no equivalent stronger proof.

* test(media): consolidate q0184 owner-boundary proof

Reuse the existing QA mock image endpoint instead of a second controlled server. Keep actual image delivery and internal completion provenance. Duplicate running/recent task interleavings remain in src/agents/tools/image-generate-tool.test.ts: starts image generation asynchronously and keeps the selected filename on completion; returns active status for a duplicate image request with the same prompt; returns recent status for a repeated image request after fast task completion.

Keep actual CONNECT routing and upstream socket identity. Oversize-before-provider execution remains in src/media-understanding/apply.test.ts: marks audio exceeding maxBytes in audio-only mode. Multipart model and file serialization remain in extensions/openai/media-understanding-provider.test.ts: builds the expected request payload.

Keep real cross-origin redirect rejection, empty-store checks and sensitive-header stripping. Initial private-address rejection remains in src/infra/net/fetch-guard.ssrf.test.ts: blocks private URLs and redacts their path, query and fragment from audit logs. Described-image suppression remains in src/auto-reply/media-note.test.ts and src/auto-reply/reply/current-turn-images.test.ts.

Retain prepared music-provider invocation, real persistence and invalid-format rejection; control normalization and forwarding remain in src/music-generation/runtime.test.ts and src/agents/tools/music-generate-tool.test.ts. Minimize unused catalog/override fixtures and remove redundant request cursor setup on a fresh mock server.

CI-only: no tests or coverage runs. Plain oxlint, oxfmt and git diff --check passed. Original shard: 1239 -> 740 test lines (-40.3%), 12 -> 8 declarations. This follow-up: 1026 -> 740 lines. All seven scenario test paths remain; no production or shared helper changes.

* test(scripts): consolidate q0179 owner-level proof

Port the remaining q0179 consolidation onto the campaign lane. The first two shard commits are already present as 8b5d5956ef16 and 6977002b3a0a. Preserve the lane removal of obsolete locale artifact-fault variants.

CI-only validation: plain oxlint and oxfmt --check passed on all nine touched files; git diff --check passed. Independent review found no actionable P0-P2 findings. No tests or builds were run.

* test(scripts): deslop q0186 tests

Reuse script fixture files and centralize release planning setup without deleting cases. Recovery retains persisted report, exact call count, unique nested IDs and exec/wait checks; remove redundant read/write spy ordering and cleanup assertion. Lifecycle cleanup remains covered by src/agents/code-mode.catalog-lifetime.test.ts and code-mode.test.ts.

CI-only validation: plain oxlint, oxfmt and git diff --check. No tests or coverage executed. Shard LOC 1201 to 1174; 40 percent target not reached because remaining suites exercise distinct release, isolation, cancellation and parser behavior.

* test(scripts): remove redundant q0186 proof layers

Delete the recovery matrix transport replay. code-mode-matrix-recovery-tasks.test.ts retains settlement effects, reconciliation, report persistence and negative controls. src/agents/code-mode.agent-loop.test.ts retains parked-error recovery without replay and partial-effect recovery; code-mode.wait.test.ts retains suspension ownership, original call identity and non-replay.

Keep report grouping and unlimited-output assertions without repeating the full header snapshot. Drop duplicate registry catch-path rows; npm-publish-plan.test.ts retains missing-selector classification and plugin-npm-prepared-release.test.ts retains 404 propagation. Keep malformed selectors, both package identity checks, byte integrity and size rejection. Default runtime still exercises the Bun gateway branch; test-runtime.test.ts owns explicit runtime selection. Keep one caller-cache override rather than replaying it with the string zero.

CI-only: oxfmt, plain oxlint and diff check pass. No tests or coverage run. Cumulative shard LOC 1201 to 1058; 40 percent target remains unmet. No obsolete subjects or further equivalent security/lifecycle proof found.

* test(scripts): consolidate q0186 owner-boundary proof

Drop duplicate skip-report CLI and grouping cases: inventory-report-cli.test.ts owns argument parsing and unlimited output; test-env-mutation-report.test.ts owns the shared grouped renderer. Keep skip-specific classification and empty output.

Consolidate same/new Android train execution in one two-row table with version, properties, plist and release-note assertions. Shared flag behavior remains in arg-utils.test.ts and android-version.test.ts. Private handoff observations now follow successful injection and store preflight, retaining independent launch matching and per-consumer witnesses.

CI-only: oxfmt, plain oxlint and diff check pass; no tests or coverage executed. Cumulative shard LOC 1201 to 970. Further reduction to 40 percent was not supported by equivalent retained boundary proof.

* test(ui): deslop q0187 tests

Keep browser coverage for blocked submission, IME/stale metadata, disappearing usage selections, avatar timeout layout, and rail geometry. Drop repeated scenario variants covered by the retained scenarios and owner tests.

Remaining owner proof: pages/new-session/composer.test.tsx (disabled Start reports attempts); pages/chat/components/chat-pane-header.test.tsx and e2e/session-management.rename.e2e.test.ts (IME and ordinary Escape); components/agent-select.test.ts and components/solid/identity-avatar.test.tsx (loaded/error avatar state and rerenders); packages/normalization-core/src/utf16-slice.test.ts (ASCII and surrogate truncation). All UI paths are under ui/src/.

CI-only campaign: oxfmt, plain oxlint, and git diff --check pass. No runtime tests or coverage executed. Retain distinct lifecycle, accessibility, geometry, and persistence scenarios; line reduction is below the 40 percent target.

* test(ui): deslop q0189 tests

Remove the Agents alias replay: pages/agents/view.test.tsx covers canonical names and configured aliases, and pages/agents/agents-page.test.ts covers loading the selected agent's configured catalog once. Retain the chat picker case for provider-suffix rendering and replace manual context cleanup with the suite-owned page lifecycle.

* test(ui): remove redundant q0189 e2e layers

Remove the llama.cpp provider replay: model-setup-lmstudio.e2e.test.ts owns the shared prepare, confirm, activate and settings flow. pages/model-setup/view.test.ts covers llama.cpp choices and icons; configured-model.test.ts covers its model state; model-setup-page.test.ts covers autonomous progress; model-setup-explicit.e2e.test.ts keeps consent; components/modal-dialog.browser.test.ts owns animation visibility.

Keep runtime budgets in Chromium. Delegate denied choices and default reset to pages/chat/components/chat-model-policy.test.ts, pages/chat/chat-model-runtime.test.ts and lib/chat/model-select-state.test.ts. Delegate private mirror hydration to components/session-background.test.ts and app/server-prefs.background.test.ts while retaining first-paint requests.

Keep rejected publication, prepared history, draft and canonicalization in one browser flow. route-prepared-identity.test.ts retains conflicting resolver and ordinary resolution branches. pages/custodian/custodian-session-store.test.ts owns persistence across stores; keep Home and palette navigation in Chromium. Reuse equivalent context and frame helpers; keep all ACK interleavings and typing work assertions.

CI-only: no tests, coverage or builds run. Plain oxlint, oxfmt and diff-check pass. Original shard 936 lines to 559 lines (40.3 percent reduction); only deleted-path entries removed from CI owner and timing lists.

* test(scripts): deslop q0188 tests

Remove copied suppression inventory and redundant planner serialization/prerequisite assertions. ci-changed-node-test-plan.test.ts retains canonical paired-owner checks and the Git tooling codec/prerequisite round trip. Keep precise selection ownership here.

Consolidate empty changelog proof at the Android release-note boundary, share model assertions and createRequire fixtures, and simplify preflight rejection setup without removing release safety cases.

CI-only campaign: oxlint, oxfmt and diff checks pass; runtime tests and coverage deferred to hosted CI. Reduction is 81 of 1194 lines (6.8%); retain distinct safeguards rather than force the 40% target.

* test(scripts): consolidate q0188 tooling proof layers

Remove the filename-based memory import graph, stale host-literal inventory, provider metadata restatements and repeated planner/runtime matrices. Keep curl limits at the executable boundary and reuse filesystem/Git fixtures.

Remaining owner proof: ci-changed-node-test-plan.test.ts retains delivery-cache coverage and private QA preparation, plus precise TUI/Git owner selections; ci-run-node-test-shard.test.ts keeps changed qualification inputs on Vitest; onboard-config-fixtures.test.ts writes guided skip-UI fixtures through the same mock config owner.

Keep unique store identity/exhaustion, auth retry/cooldown, ref-integrity, syntax scanner and release dispatch guards. Static lint/format/diff checks pass; no test or coverage runs in CI-only mode. Original shard 1194 lines -> 840 (29.6%): 40% target remains unmet.

* test: repair d467 fixtures and preserve private-target proof

* test: type optional lint fixture lines explicitly
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…2570)

* test(ui): deslop q0178 tests

Remove the duplicate long-diff E2E layer: chat-session-diff-folding.real-gateway.e2e.test.ts covers the identical 64x680 fixture, unified/split rendering, and refresh collapse. session-diff-split.test.ts covers budget fallback and source preservation; chat-session-diff.e2e.test.ts covers deferred refresh.

Keep Mermaid touch, clipboard, and source-view expansion; markdown-mermaid-expansion.browser.test.ts owns click/keyboard activation and focus return. Remove success-only Mermaid/bootstrap media capture and compact the message fixture.

CI-only campaign: local oxlint, oxfmt, and diff checks passed; no tests or coverage run. Shard LOC 1310 to 1109 (15.3%); below the 40% target because remaining scenarios cover distinct behaviors.

* test(qa-lab): remove redundant q0174 product-proof layers

Port q0174 onto the campaign lane. The first source commit fb59ddd0922ae0e453987344a4b8be4d723ab551 is already present as 415487d52d22; apply the remaining cleanup from 43b21095aece1a8025b51228db60f96cc412344e without changing newer lane content.

Resolve the timing-map conflict by deleting only the inherited-policy entry, preserving the lane removal of the neighboring join-intro entry. Retain CLI SecretRef repair and exec gating, running-Gateway session cleanup, and manual worktree lifecycle proof; remove redundant product-proof layers.

Validation: oxlint and oxfmt --check passed on retained touched files; git diff --check and cached diff check passed. Independent read-only review found no actionable issues. Tests not run under the requested CI-only policy.

* test(ui): deslop q0180 tests

Remove duplicate RPC-envelope assertions and unasserted catalog screenshots. Use the shared page lifecycle for disk-space proof and one assertion helper for linked-session navigation before and after reload.

Remaining owner proof: browser-client.test.ts scopes only the session panel and sends transcript references only with its list; browser-panel-controller-input.test.ts captures a successfully navigated document when its tab snapshot fails; model-catalog-store.test.ts reuses pending catalogs until the native discovery owner invalidates them; chat-pane-model-catalog.test.ts revalidates the configured model catalog when the picker opens; cron-page.lifecycle.test.ts verifies configured agent-scoped model requests.

Preserve all 13 expanded cases: retry geometry/animation and text scale, export download/clipboard attribution, descendant network blocking through sandbox transitions, real response-body cancellation and error presentation, linked navigation identity/reload, dynamic reasoning/context convergence, accessible disk-pressure recovery, and retained/empty catalog warning isolation. These distinct browser behaviors prevent an honest 40% reduction. LOC 1054 -> 993 (-5.8%).

CI-only validation: plain oxlint exit 0, oxfmt and git diff --check passed. No tests, coverage, Testbox, typecheck, or build run.

* test(ui): remove redundant q0180 e2e layers

Delete chat-export-attribution and cron-agent-ownership E2E replays. Export transport/content remains covered by export.test.ts (readable download and speaker normalization), chat-send-submit.test.ts (local export commands), session-menu-navigation.test.ts (chronological transcript copy), and chat-message.forwarded-attribution.test.ts (never borrow viewer identity). Cron failure/empty recovery remains in cron-page.lifecycle.test.ts, draft preservation and event ordering in cron-page.catalog-notifications.test.ts, and catalog replacement/reopen in command-palette.test.ts. The palette model projection consumes models only, not catalog warning fields.

Retain browser screenshot authentication and visible failure, but remove Fetch instrumentation duplicated by browser-client.test.ts: rejects an unsuccessful screenshot without waiting for stream cancellation. Keep disk event-to-accessible-badge proof; chat-view.test.ts owns persistent disk guidance and recovery. Keep dynamic Chat convergence; new-session model-control tests own hydrated defaults/catalog rendering and metadata lifecycle. Drop request-count replays covered by chat-pane-model-catalog.test.ts and the catalog owner. Keep click and direct-link reload proof with colliding prefixes; the no-collision row takes the same full-UUID route branch.

Shrink only the deleted files entries in the private-server path list and E2E owner inventory. No production or helper changes. Original shard LOC 1054 -> 631 (-40.1%); this follow-up 993 -> 631. Eight expanded cases remain. CI-only: no tests, coverage, builds, or typechecks run. Plain oxlint exit 0, oxfmt, and git diff --check passed.

* test(ui): remove redundant q0172 lifecycle replays

Port q0172 from edd7ef1d27b7a9d29ba1340bbffb74c8f35eb854 and 0a4542847769cdc76fbcc911ec36bccf7ebfdaf5 onto the campaign lane. The first cleanup is already present; preserve it and all newer lane inventory changes while applying the remaining lifecycle replay removals and layout fixture cleanup.

Validation: plain oxlint, oxfmt --check, and git diff --check exited 0. Isolated review found no actionable issues. CI-only: no tests, coverage, Testbox, or check-changed were run.

* test(scripts): deslop q0177 tests

Reuse the existing HTTP fixture lifecycle in the installer proof and replace branching prefix fixture setup with explicit overrides. Preserve all installer, provenance, secret-handling, continuation, archive and prefix-stability contracts.

Drop the redundant explicit-true plugin fixture variant (default-enabled and disabled remain) and short-option budget replays (the retained long-option case reaches the same startsWith rejection). Keep budget-specific duplicate-option coverage.

CI-only campaign: formatting, diff-check and plain oxlint passed; tests and coverage deferred to hosted CI. The shard is already compact and the 40 percent LOC target was not achievable without dropping distinct boundary proof.

* test(scripts): consolidate q0177 owner-boundary proof

Remove the benchmark discovery lifecycle replay: src/gateway/server-discovery-runtime.test.ts owns starts registered local discovery services with gateway advertisement context and replaces advertisements and wide-area metadata across live mode and registry changes. Retain benchmark config and environment isolation here.

Keep formatted statistics and default plugin activation in test/scripts/bench-gateway-startup.test.ts, including requires seeded session access and clean shutdown only for populated fixtures and the teamBoot fixture assertions. Keep CI evidence emission in test/scripts/tsgo-core-test-shards.test.ts, including executes assigned root partitions serially through mixed CI and its transitive-consumer evidence cases.

Move runtime-log expectations into the saved-log CLI replay, consume the actual redaction result in notification proof, and assert timed report totals through the budget CLI. Share installer scenario orchestration and reuse the existing archive file builder without changing its public fixture interface.

CI-only: plain oxlint, oxfmt and diff-check passed. No tests or coverage run. Shard totals 1239 to 1087 lines; 40 percent remains unmet because the remaining independent security, platform, parser and lifecycle proof has no replacement.

* test(scripts): preserve installer failure propagation

Run the two POSIX installer subshells as standalone commands under set -e. The preceding consolidation put the healthy installer on the left side of &&, which can suppress errexit inside that subshell. Keep independent EXIT traps without changing the installer behavior under test. Static inspection only under the campaign CI-only instruction; no test runs.

* test(scripts): remove redundant q0177 metadata assertion

The retained real notify call reads the redaction-result file and requires a boolean notify_required before it can report the asserted skipped result. Remove the duplicate direct file assertion; preserve the notification-gating regression from be4e5ec.

Re-audited PASS 15 moves 1-5: no stale subjects, source-grep inventories, or further safe whole-case deletions remain. Existing distinct security, provenance, runtime accounting, and compiler lifecycle cases block the 40 percent target. Formatting, plain oxlint and diff-check pass; no tests or coverage run under CI-only mode.

* test(scripts): deslop q0179 tests

Trim same-branch documentation and runtime-path variants. Keep the import-cycle and Kysely regressions from 19ad4ab and b5049b8, plus the harness-runtime shutdown guard from 27cbae0.

Use a direct oversized command in the transport fixture; pr-crabbox-gate-plan.test.ts owns canonical command construction and forwarding. Retain transport hash, exact-byte, oversized payload, tamper and child-join coverage. Remove unused auth fixture timestamps and share legacy-owner assertions across absent and pre-v7 shared databases.

CI-only campaign: plain oxlint, oxfmt and diff-check passed; no tests or coverage run. 1200 to 1172 shard lines; below the 40% target because remaining suites protect distinct release, auth, CI and lifecycle boundaries. No production changes.

* test(scripts): reduce q0179 fixture and assertion layers

Derive copied release closures from entry points and reuse publication-source paths; retain explicit frozen-workflow inputs. Minimize SQLite auth fixtures to the actual queried schema while preserving all schema-owner and view-rejection scenarios.

Remove repeated path and Kysely preparation variants, diagnostic wording/file-count assertions, workflow-step traces, and the transport builder replay. The retained oversized Linux payload, tamper and cleanup cases own transport behavior; pr-crabbox-gate-plan.test.ts owns command generation. The startup corpus tier case in ci-node-test-plan.test.ts owns canonical startup inclusion. Keep exact runtime inventory and changed timing-root assertions.

CI-only validation: plain oxlint exit 0, oxfmt and diff-check clean. No tests, coverage, builds or Testbox. Shard totals 1200 -> 993 lines (17.3%); 40% remains unmet rather than deleting distinct security, release or lifecycle proof. No production changes or files deleted.

* test(scripts): deslop q0181 tests

Consolidate iOS fixture ownership and package-fixture subprocess assertions. Remove Android routing restatements covered by ci-workflow-planning tests for native Access job and gate selection.

Remove the CLI transport source grep: invocation behavior remains covered by cli-invocation.test.ts, node-runtime-recovery.test.ts (preserves invocation and replacement exit), and respawn-child-runner.process.test.ts (real transport completion).

CI-only campaign: formatting, diff check, and plain oxlint pass. No tests or coverage run. Retain distinct signing, release selection/evidence, SDK removal, correlation ordering, and transition ownership cases; the shard cannot meet 40 percent without deleting their only proof.

* test(scripts): remove redundant q0181 proof layers

Drop workflow wiring and copied inventories while retaining permission, evidence allowlist, tooling pin, executable shell guard, and native report/APK validation contracts. Package ignore behavior is asserted through the staged Git tree.

Replace the preload-byte snapshot with existing executable coverage in src/process/respawn-child-runner.process.test.ts, src/infra/node-runtime-recovery.test.ts, and test/scripts/bun-standalone-support.test.ts. Consolidate iOS canonical selection into the real metadata-parser fixture. Retain followup transition cases instead of repeating the same accepted merge/rebase branches; keep all refusal cases.

CI-only validation: plain oxlint, oxfmt, and git diff --check passed. No tests or coverage run. This second pass remains below the 40 percent target because the remaining suites retain distinct owner branches and shared merge assertion support.

* test(scripts): consolidate q0181 driving fixtures

Share standalone manifest setup across projection and admission tests without dropping metadata branches. Keep the three signing-team decision paths in a compact table and remove same-path SwiftLint invalid-name input variants.

Read-only sibling audit confirms CLI manifest admission, package offline installation/relocation, and committed merge/rebase resolve-undo ownership have no equivalent replacement tests. Shared PR assertion helpers also have out-of-shard callers and cannot be deleted without breaking them. No subject in this shard is retired.

CI-only: oxfmt, plain oxlint and diff check passed; no tests or coverage run. Total remains below the requested 40 percent reduction rather than deleting uniquely covered behavior.

* test(ui): deslop q0182 tests

Reuse existing board and response fixtures and consolidate repeated model filtering setup. Keep every scenario and distinct assertion: the remaining split-face URL poll subsumes the substring check, strict visible person locators subsume duplicate count checks, and the retained error-state filter cycle covers provider filtering.

* test(scripts): deslop q0183 tests

Keep one curl failure per native installer: exit 28 and 56 both terminate at the same set -e boundary, with no status-specific branch. Retain timeout flags, pinned URLs, checksum rejection, and version checks.

Share worker stdout/stderr capture and reuse the existing module-membership predicate without dropping stream closure, bounded output, bundle isolation, or restore/export assertions. CI-only campaign: formatting, diff check, and plain oxlint pass; runtime proof is deferred to hosted CI. Shard lines 1363 -> 1346; distinct contracts prevent the requested 40% cut.

* test(scripts): consolidate q0183 proof layers

Retain emitted stream isolation from regression 096fe2a while sharing owner assertions. The state-read-worker-stream fixture already asserts the selected emitted URL and ordered restore/export values; managed-child-process.drain and .output tests own process/pipe settlement. Retain managed command cleanup rather than reimplementing its observers here.

Keep one legacy-import scenario through recovery, retained blobs, and Git collection; generic immediate completion remains in pr-merge-outcome tests. Keep measured-large failure, empty-state equality, and explicit override budget branches. Drop duplicate tagged-reference input and process option restatements; keep inspection bounds and attestation rejection.

CI-only: plain oxlint, oxfmt, and diff check pass. No tests or coverage run. Shard 1363 -> 1275 lines, below 40 percent target; remaining proof covers distinct behavior, including security and regression boundaries.

* test(ui): deslop q0185 tests

Remove exact microphone-guidance replay covered by browser-talk-microphone-lifetime.e2e.test.ts, and numeric stepping/search dismissal replays covered by plugins-settings-keyboard.e2e.test.ts. Keep all consent decisions and whole-value schema branches.

Retire the mocked restart E2E layer: chat-pane-recovery.test.ts retains in-place recovery, rejected continuation, replacement navigation and draft preservation; chat-composer-disabled-banner.test.ts retains action dispatch and busy rendering. Both owner layers cover the original openclaw#173579 regression.

Keep sidebar keyboard, pushed-update and narrow viewport proof; session-hovercard.test.ts owns PR ordering/states/checks and session-progress-hovercard-target.test.ts owns pushed rate-limit notices. Keep tweet media, missing-preview and long-text paths; remove ordinary text rows already exercised by media and long-text cases.

Remove screenshot-only artifact generation and duplicate pagination failure diagnostics, preserving assertions and shared harness capture. CI-only campaign: no runtime or coverage runs. Static oxlint, oxfmt and diff checks pass. Test LOC 1120 -> 749 (33.1%); declarations 11 -> 7; expanded cases 25 -> 14. Below the 40% line target because remaining flows are distinct.

* test(media): deslop q0184 tests

Remove redundant media-understanding and fetch scenarios while retaining real CLI, proxy, channel lifecycle, SSRF, redirect and prepared music-provider integration proof.

Audio selection remains covered by src/media-understanding/attachments.guards.test.ts, apply.test.ts (preflight skips and last-preference transcript ordering), and audio-preflight.attachments.test.ts (configured selection and limits). Native vision handoff remains in runner.vision-skip.test.ts; current-turn-images.test.ts covers native bytes and described-image suppression.

Music fallback, unsupported controls and duration normalization remain in src/music-generation/runtime.test.ts. src/agents/tools/music-generate-tool.test.ts covers explicit deployment refs, ignored-override warnings and normalized-duration details. Keep prepared-provider invocation, audio persistence and invalid-format rejection here.

Both fetch overflow paths and empty-store cleanup remain in src/media/fetch.test.ts: cleans up streamed/content-length media overflow before a response clone is released. Remove the obsolete native-catalog mock baseline entry.

CI-only: no tests or coverage run. oxfmt, plain oxlint and git diff --check passed. Shard test lines: 1239 -> 1026 (17.2%); declarations: 12 -> 9. Below the 40% target because remaining transport, lifecycle and security compositions have no equivalent stronger proof.

* test(media): consolidate q0184 owner-boundary proof

Reuse the existing QA mock image endpoint instead of a second controlled server. Keep actual image delivery and internal completion provenance. Duplicate running/recent task interleavings remain in src/agents/tools/image-generate-tool.test.ts: starts image generation asynchronously and keeps the selected filename on completion; returns active status for a duplicate image request with the same prompt; returns recent status for a repeated image request after fast task completion.

Keep actual CONNECT routing and upstream socket identity. Oversize-before-provider execution remains in src/media-understanding/apply.test.ts: marks audio exceeding maxBytes in audio-only mode. Multipart model and file serialization remain in extensions/openai/media-understanding-provider.test.ts: builds the expected request payload.

Keep real cross-origin redirect rejection, empty-store checks and sensitive-header stripping. Initial private-address rejection remains in src/infra/net/fetch-guard.ssrf.test.ts: blocks private URLs and redacts their path, query and fragment from audit logs. Described-image suppression remains in src/auto-reply/media-note.test.ts and src/auto-reply/reply/current-turn-images.test.ts.

Retain prepared music-provider invocation, real persistence and invalid-format rejection; control normalization and forwarding remain in src/music-generation/runtime.test.ts and src/agents/tools/music-generate-tool.test.ts. Minimize unused catalog/override fixtures and remove redundant request cursor setup on a fresh mock server.

CI-only: no tests or coverage runs. Plain oxlint, oxfmt and git diff --check passed. Original shard: 1239 -> 740 test lines (-40.3%), 12 -> 8 declarations. This follow-up: 1026 -> 740 lines. All seven scenario test paths remain; no production or shared helper changes.

* test(scripts): consolidate q0179 owner-level proof

Port the remaining q0179 consolidation onto the campaign lane. The first two shard commits are already present as 8b5d5956ef16 and 6977002b3a0a. Preserve the lane removal of obsolete locale artifact-fault variants.

CI-only validation: plain oxlint and oxfmt --check passed on all nine touched files; git diff --check passed. Independent review found no actionable P0-P2 findings. No tests or builds were run.

* test(scripts): deslop q0186 tests

Reuse script fixture files and centralize release planning setup without deleting cases. Recovery retains persisted report, exact call count, unique nested IDs and exec/wait checks; remove redundant read/write spy ordering and cleanup assertion. Lifecycle cleanup remains covered by src/agents/code-mode.catalog-lifetime.test.ts and code-mode.test.ts.

CI-only validation: plain oxlint, oxfmt and git diff --check. No tests or coverage executed. Shard LOC 1201 to 1174; 40 percent target not reached because remaining suites exercise distinct release, isolation, cancellation and parser behavior.

* test(scripts): remove redundant q0186 proof layers

Delete the recovery matrix transport replay. code-mode-matrix-recovery-tasks.test.ts retains settlement effects, reconciliation, report persistence and negative controls. src/agents/code-mode.agent-loop.test.ts retains parked-error recovery without replay and partial-effect recovery; code-mode.wait.test.ts retains suspension ownership, original call identity and non-replay.

Keep report grouping and unlimited-output assertions without repeating the full header snapshot. Drop duplicate registry catch-path rows; npm-publish-plan.test.ts retains missing-selector classification and plugin-npm-prepared-release.test.ts retains 404 propagation. Keep malformed selectors, both package identity checks, byte integrity and size rejection. Default runtime still exercises the Bun gateway branch; test-runtime.test.ts owns explicit runtime selection. Keep one caller-cache override rather than replaying it with the string zero.

CI-only: oxfmt, plain oxlint and diff check pass. No tests or coverage run. Cumulative shard LOC 1201 to 1058; 40 percent target remains unmet. No obsolete subjects or further equivalent security/lifecycle proof found.

* test(scripts): consolidate q0186 owner-boundary proof

Drop duplicate skip-report CLI and grouping cases: inventory-report-cli.test.ts owns argument parsing and unlimited output; test-env-mutation-report.test.ts owns the shared grouped renderer. Keep skip-specific classification and empty output.

Consolidate same/new Android train execution in one two-row table with version, properties, plist and release-note assertions. Shared flag behavior remains in arg-utils.test.ts and android-version.test.ts. Private handoff observations now follow successful injection and store preflight, retaining independent launch matching and per-consumer witnesses.

CI-only: oxfmt, plain oxlint and diff check pass; no tests or coverage executed. Cumulative shard LOC 1201 to 970. Further reduction to 40 percent was not supported by equivalent retained boundary proof.

* test(ui): deslop q0187 tests

Keep browser coverage for blocked submission, IME/stale metadata, disappearing usage selections, avatar timeout layout, and rail geometry. Drop repeated scenario variants covered by the retained scenarios and owner tests.

Remaining owner proof: pages/new-session/composer.test.tsx (disabled Start reports attempts); pages/chat/components/chat-pane-header.test.tsx and e2e/session-management.rename.e2e.test.ts (IME and ordinary Escape); components/agent-select.test.ts and components/solid/identity-avatar.test.tsx (loaded/error avatar state and rerenders); packages/normalization-core/src/utf16-slice.test.ts (ASCII and surrogate truncation). All UI paths are under ui/src/.

CI-only campaign: oxfmt, plain oxlint, and git diff --check pass. No runtime tests or coverage executed. Retain distinct lifecycle, accessibility, geometry, and persistence scenarios; line reduction is below the 40 percent target.

* test(ui): deslop q0189 tests

Remove the Agents alias replay: pages/agents/view.test.tsx covers canonical names and configured aliases, and pages/agents/agents-page.test.ts covers loading the selected agent's configured catalog once. Retain the chat picker case for provider-suffix rendering and replace manual context cleanup with the suite-owned page lifecycle.

* test(ui): remove redundant q0189 e2e layers

Remove the llama.cpp provider replay: model-setup-lmstudio.e2e.test.ts owns the shared prepare, confirm, activate and settings flow. pages/model-setup/view.test.ts covers llama.cpp choices and icons; configured-model.test.ts covers its model state; model-setup-page.test.ts covers autonomous progress; model-setup-explicit.e2e.test.ts keeps consent; components/modal-dialog.browser.test.ts owns animation visibility.

Keep runtime budgets in Chromium. Delegate denied choices and default reset to pages/chat/components/chat-model-policy.test.ts, pages/chat/chat-model-runtime.test.ts and lib/chat/model-select-state.test.ts. Delegate private mirror hydration to components/session-background.test.ts and app/server-prefs.background.test.ts while retaining first-paint requests.

Keep rejected publication, prepared history, draft and canonicalization in one browser flow. route-prepared-identity.test.ts retains conflicting resolver and ordinary resolution branches. pages/custodian/custodian-session-store.test.ts owns persistence across stores; keep Home and palette navigation in Chromium. Reuse equivalent context and frame helpers; keep all ACK interleavings and typing work assertions.

CI-only: no tests, coverage or builds run. Plain oxlint, oxfmt and diff-check pass. Original shard 936 lines to 559 lines (40.3 percent reduction); only deleted-path entries removed from CI owner and timing lists.

* test(scripts): deslop q0188 tests

Remove copied suppression inventory and redundant planner serialization/prerequisite assertions. ci-changed-node-test-plan.test.ts retains canonical paired-owner checks and the Git tooling codec/prerequisite round trip. Keep precise selection ownership here.

Consolidate empty changelog proof at the Android release-note boundary, share model assertions and createRequire fixtures, and simplify preflight rejection setup without removing release safety cases.

CI-only campaign: oxlint, oxfmt and diff checks pass; runtime tests and coverage deferred to hosted CI. Reduction is 81 of 1194 lines (6.8%); retain distinct safeguards rather than force the 40% target.

* test(scripts): consolidate q0188 tooling proof layers

Remove the filename-based memory import graph, stale host-literal inventory, provider metadata restatements and repeated planner/runtime matrices. Keep curl limits at the executable boundary and reuse filesystem/Git fixtures.

Remaining owner proof: ci-changed-node-test-plan.test.ts retains delivery-cache coverage and private QA preparation, plus precise TUI/Git owner selections; ci-run-node-test-shard.test.ts keeps changed qualification inputs on Vitest; onboard-config-fixtures.test.ts writes guided skip-UI fixtures through the same mock config owner.

Keep unique store identity/exhaustion, auth retry/cooldown, ref-integrity, syntax scanner and release dispatch guards. Static lint/format/diff checks pass; no test or coverage runs in CI-only mode. Original shard 1194 lines -> 840 (29.6%): 40% target remains unmet.

* test: repair d467 fixtures and preserve private-target proof

* test: type optional lint fixture lines explicitly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants