Skip to content

fix: show saved child results when idle delivery expires - #202732

Merged
steipete merged 2 commits into
mainfrom
steipete/fix-idle-completion-expiry-2707
Nov 20, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/fix-idle-completion-expiry-2707

Conversation

@steipete

@steipete steipete commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A child interrupted during Gateway restart can retain a pending completion while its requester stays idle. At the 30-minute hard deadline, the registry discarded that completion without telling the requester or logging its retirement.

User Impact

An expired required completion now records a visible failure notice containing the saved public result, with the existing truncation bounds and full-history recovery guidance, plus an operator warning. The requester can recover the result or start replacement work without needing another turn to discover the failure.

Why This Change Was Made

Idle and suspended expiry now share the existing retirement and notice owner. The separate quiet discard implementation is removed: net production LOC is -13. Idle expiry still releases orphaned reservations, defers delete cleanup to the sweeper, and does not run an ended hook or model turn. Queued deliveries, active producers, requester cohorts and not-required deliveries retain their existing behavior. No config/schema/cache/tool change.

The Team perf-loop lead, an agent acting under Peter's standing unattended instruction, requested this scoped repair and landing. This is the agent lead's decision, not Peter's personal acceptance. Related: #202664, #202708.

Evidence

On base 8253356c986427d888cbe24b2c3d6f3b702a2f79, the real SQLite/transcript sweeper regression fails because idle pending expiry produces zero visible notices; suspended expiry and not-required controls pass. The fixture restores a drain-interrupted terminal outcome with captured text, leaves the requester idle, and sweeps before and at the deadline. With the fix, the visible notice includes the saved answer, expired reason, restart-interruption status, truncation marker and full-result recovery instructions; full stored text survives unchanged.

All 37 focused tests pass across five files (76.26 seconds wrapper time). The changed expiry file's three cases take 5.257 seconds. Existing tests also cover reservation release, queued/deferred-delete custody, sweep cadence, backlog warnings, private-result isolation and notice bounds. Codex P0–P2 autoreview is clean. This is synthetic persistence/sweeper boundary proof; no production data, transcript content or live-model claim.

Complete pnpm check:changed passes lint, production and all test typechecks, format, SQLite/schema ownership guards and import-cycle checks. Its only failed gate is the export scan: createSkillPageReads and createSkillPageRoute in ui/src/pages/skills/skill-page-route.ts. Both reproduce on exact main parent 8253356c986427d888cbe24b2c3d6f3b702a2f79 and were added by #202581 (1ee9f29e6668e32ecfade57a540d10326ad3b8de). This is a main regression for the UI owner, not a green check. The parent-only voice-call dependency-link diagnostics are excluded from that attribution; the full-tree scan matches exactly.

The first CI run exposed a PR-caused suspended-yield ordering regression. The correction preserves cleanup/hook ordering and records the notice in finally, so tail failure cannot skip it. All 10 worker-boundary cases and three expiry cases pass after correction (73.99 seconds wrapper time); fresh Codex P0–P2 autoreview is clean. Final-head ClawSweeper reports zero findings and zero open items.

Final CI 44823493541 on 32ffe6aab90ccf9ab80ea7a72686455fc5515801 passes the repaired Node shard and every other root check except UI shard 1: skills loads 30 assets against 28, skill settings 33 against 31. Both reproduce exactly on CI's actual main parent 3bf86304325f0ccfbe2c868081cfa004294dc159 on Linux (109.056 seconds command, 289.001 seconds including sync). The two local export diagnostics also reproduce there. The current extra skill-page-boundary/detail-loading-hero imports and unused exports come from #202581 (1ee9f29e6668e32ecfade57a540d10326ad3b8de). These are main regressions for the UI owner, not noise. The tested merge changes no UI/scenario inputs. Landing uses the scoped inherited-failure route; CI and the export scan remain explicitly failed.

Share expiry retirement with suspended delivery so an idle requester receives the existing capped saved-result notice and an operator warning. Preserve orphaned-reservation release and deferred session deletion.
@clawsweeper

clawsweeper Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels Nov 20, 2026
@steipete
steipete marked this pull request as ready for review November 20, 2026 21:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T21:50:22.856409Z 32ffe6a 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.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review the current head for shared idle/suspended expiry retirement, required visible saved-result notices, and preservation of deferred delete cleanup and quiet not-required delivery. The real persistence/transcript regression is red on base and the 37 focused tests pass.

@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 20, 2026
@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Idle child-completion expiry now records the existing saved-result failure notice and an operator warning.

Example: A restart-interrupted child saved “The missing invoice is in archive A” while its requester remains idle for 30 minutes.

  • Before: The pending completion expires without a requester-visible notice.
  • After: The requester transcript receives a bounded failure notice containing the saved answer and recovery guidance.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation has no identified code defect, but synthetic tests do not satisfy the required shipped-behavior proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An idle requester receives no visible outcome when a restart-interrupted child's saved completion expires.
Reason: The maintainer-authored direction restores the existing visible-outcome contract and removes duplicate retirement logic without adding settings or a delivery owner.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current-main silent expiry path using the existing retirement owner; no actionable code defect was found on the reviewed head.

Priority: P2
Reviewed head: 32ffe6aab90ccf9ab80ea7a72686455fc5515801

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted Gateway output or a recording showing a restart-interrupted child's pending completion expiring while its requester stays idle and the saved-answer notice becoming visible.
Agent review details

How this fits together

The subagent registry sweeper consumes durable execution and delivery records, retires expired completion obligations, releases controller reservations, and records notices in the requester transcript.

flowchart TD
  A[Saved child completion] --> B[Registry sweeper]
  B --> C[Expiry eligibility]
  C --> D[Shared retirement owner]
  D --> E[Cleanup bookkeeping]
  D --> F[Requester transcript notice]
  E --> G[Deferred session cleanup]
Loading

Technical review

Best possible solution:

Keep one expiry-retirement owner that records saved-result notices while preserving reservation release, suspended hook ordering, and deferred deletion.

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

Current-main source shows eligible idle completions being discarded without calling the notice writer; the PR reports the matching regression failing on base and passing on head, but no tests were executed during this read-only review.

Is this the best way to solve the issue?

The change is the smallest complete consolidation using existing owners: eligibility remains unchanged, the parallel quiet path disappears, and each changed test case protects a distinct expiry or non-delivery contract.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Idle completion expiry changes intended behavior with a stated reason (b7861d6: Release orphaned FIFO reservations without changing queued delivery or deferred cleanup; quiet loss was explicitly accepted in fix: unblock parent input behind orphaned subagent completions #185549.)
  • Suspended retirement and hook ordering keeps the original intent (7aaf302: Keep restart recovery and terminal effects under the registry lifecycle owner; later durable-cleanup work retained attachment-before-hook ordering.)
  • Expiry notice and saved answers keeps the original intent (3b61a7c: Prevent required suspended results from disappearing silently; later saved-result rendering supplies bounded public answers.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -13, Tests +16, Docs +1. Total +4 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 98 111 -13
Tests 2 97 81 +16
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 198 194 +4

Preflight source

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded restart-and-expiry path silently hides a saved child answer while the requester remains idle.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-20T21:35:11.048Z sha 75f696f :: needs maintainer review before merge. :: none

Reviewed November 20, 2026, 4:53 PM ET / 21:53 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 32ffe6a corrects a CI-detected suspended-yield ordering regression. Cleanup/hook ordering is preserved and the required notice runs in finally, including on tail failure. The existing 10 worker-boundary tests and three expiry cases pass, and fresh Codex autoreview is clean. Please review this final head; prior review had no numbered findings.

@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 1a60c2d into main Nov 20, 2026
132 of 135 checks passed
@steipete
steipete deleted the steipete/fix-idle-completion-expiry-2707 branch November 20, 2026 22:13
@steipete

Copy link
Copy Markdown
Contributor Author

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

vincentkoc added a commit that referenced this pull request Nov 20, 2026
…202654

* origin/main: (34 commits)
  fix(ui): restore Skills first-visit asset limits (#202694)
  fix: restore Skills discovery recovery checks (#202747)
  fix(database): report disabled memory after a port (#202630)
  test(ui): settle live event imports before cursor assertions (#202752)
  fix: keep installed plugins in the Featured list instead of hiding them
  fix: keep PostgreSQL transcript and health totals numeric (#202629)
  fix(ui): show only SKILL.md in plugin skill previews
  fix: preserve the running installation when an agent updates its Gateway (#201570)
  chore(ui): refresh control ui locales (#202744)
  fix: show saved child results when idle delivery expires (#202732)
  perf(state): adopt producer-owned read commands (#202731)
  fix(cli): restore dashboard Gateway start and install recovery (#202085)
  fix: make plugin catalog artwork easier to recognize
  fix: restore queued compaction writer-fence coverage (#202709)
  fix(ui): remove resting chrome from Customize settings gears
  chore(ui): refresh control ui locales (#202734)
  fix: distinguish a recovered gateway from its failed update checks
  fix(ui): keep known plugin details visible while loading
  fix(cli): connect through gateway.remote.edgeAuth without a Gateway token
  fix: make the Plugins catalog clear when disconnected
  ...
vincentkoc added a commit that referenced this pull request Nov 21, 2026
)

* feat(gateway): add restricted writer transport and steer discovery

* refactor(gateway): retain publication owner across writer expansion

* feat: prepare restricted connections for Session Share steering

OpenClaw-Publication: d030c287-b7c5-8326-aa7e-a2b07b373ac6

* fix(gateway): distinguish disabled publication purposes at handshake

* Publish openclaw/cool-shrimp

OpenClaw-Publication: 096bcc30-6af3-892d-a6b9-456f24a4f5ba

* merge: bring main into the steering transport branch and regenerate the config baseline

* Merge remote-tracking branch 'origin/main' into land/steer-transport-202654

* origin/main: (34 commits)
  fix(ui): restore Skills first-visit asset limits (#202694)
  fix: restore Skills discovery recovery checks (#202747)
  fix(database): report disabled memory after a port (#202630)
  test(ui): settle live event imports before cursor assertions (#202752)
  fix: keep installed plugins in the Featured list instead of hiding them
  fix: keep PostgreSQL transcript and health totals numeric (#202629)
  fix(ui): show only SKILL.md in plugin skill previews
  fix: preserve the running installation when an agent updates its Gateway (#201570)
  chore(ui): refresh control ui locales (#202744)
  fix: show saved child results when idle delivery expires (#202732)
  perf(state): adopt producer-owned read commands (#202731)
  fix(cli): restore dashboard Gateway start and install recovery (#202085)
  fix: make plugin catalog artwork easier to recognize
  fix: restore queued compaction writer-fence coverage (#202709)
  fix(ui): remove resting chrome from Customize settings gears
  chore(ui): refresh control ui locales (#202734)
  fix: distinguish a recovered gateway from its failed update checks
  fix(ui): keep known plugin details visible while loading
  fix(cli): connect through gateway.remote.edgeAuth without a Gateway token
  fix: make the Plugins catalog clear when disconnected
  ...

* merge: bring main into the steering transport branch and regenerate the config baseline

* merge: bring main into the steering transport branch and regenerate the config baseline

* merge: bring main into the steering transport branch and regenerate protocol output

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 21, 2026
…2732)

* fix: show saved child results when idle delivery expires

Share expiry retirement with suspended delivery so an idle requester receives the existing capped saved-result notice and an operator warning. Preserve orphaned-reservation release and deferred session deletion.

* fix: preserve suspended expiry hook ordering
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 21, 2026
…claw#202654)

* feat(gateway): add restricted writer transport and steer discovery

* refactor(gateway): retain publication owner across writer expansion

* feat: prepare restricted connections for Session Share steering

OpenClaw-Publication: d030c287-b7c5-8326-aa7e-a2b07b373ac6

* fix(gateway): distinguish disabled publication purposes at handshake

* Publish openclaw/cool-shrimp

OpenClaw-Publication: 096bcc30-6af3-892d-a6b9-456f24a4f5ba

* merge: bring main into the steering transport branch and regenerate the config baseline

* Merge remote-tracking branch 'origin/main' into land/steer-transport-202654

* origin/main: (34 commits)
  fix(ui): restore Skills first-visit asset limits (openclaw#202694)
  fix: restore Skills discovery recovery checks (openclaw#202747)
  fix(database): report disabled memory after a port (openclaw#202630)
  test(ui): settle live event imports before cursor assertions (openclaw#202752)
  fix: keep installed plugins in the Featured list instead of hiding them
  fix: keep PostgreSQL transcript and health totals numeric (openclaw#202629)
  fix(ui): show only SKILL.md in plugin skill previews
  fix: preserve the running installation when an agent updates its Gateway (openclaw#201570)
  chore(ui): refresh control ui locales (openclaw#202744)
  fix: show saved child results when idle delivery expires (openclaw#202732)
  perf(state): adopt producer-owned read commands (openclaw#202731)
  fix(cli): restore dashboard Gateway start and install recovery (openclaw#202085)
  fix: make plugin catalog artwork easier to recognize
  fix: restore queued compaction writer-fence coverage (openclaw#202709)
  fix(ui): remove resting chrome from Customize settings gears
  chore(ui): refresh control ui locales (openclaw#202734)
  fix: distinguish a recovered gateway from its failed update checks
  fix(ui): keep known plugin details visible while loading
  fix(cli): connect through gateway.remote.edgeAuth without a Gateway token
  fix: make the Plugins catalog clear when disconnected
  ...

* merge: bring main into the steering transport branch and regenerate the config baseline

* merge: bring main into the steering transport branch and regenerate the config baseline

* merge: bring main into the steering transport branch and regenerate protocol output

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Nov 22, 2026
…9388 stage 4)

Absorbs openclaw/openclaw main 5a3e6b1
(473 commits past the absorbed 1129d4c, which is the merge-base) into
16541aa, so openclaw#129388's presentation can fast-forward. rerere was off for
the merge; nothing arrived pre-staged.

24 content conflicts:
- Generated, regenerated rather than hand-merged: config-baseline counts
  and sha256 (config:docs:gen; core 2667 + fork 17 = 2684), gateway
  predicates.js (gateway:validators:gen), and the four PostgreSQL state
  catalogs (db:postgres:gen).
- package.json schemaVersions: state 41 (upstream openclaw#201615) with the
  fork's agent 44 (continuation's recipient-authority step; upstream's
  agent ladder is still at 43).
- plugin-sdk-surface-report budgets: upstream's +2 (openclaw#203044) plus the
  fork's unchanged +11 / +4.
- subagent-registry-queries: upstream openclaw#203102 folded
  excludeSuspendedDelivery into excludeSettledDelivery; T1's
  unconditional suspended-unbound skip stays.
- subagent-registry-suspended-delivery: upstream openclaw#202732 restructured the
  discard into discardExpiredSubagentDelivery with the expiry notice in a
  finally block; T1's suspended-unbound outcome still notifies no session.
- agent-runner-result-accounting, update-command-service-command,
  session-reset-service, assistant-answer-text,
  state-port.postgres.test, vitest.database-worker-core-paths: both
  sides kept (imports, openclaw#201615 permission checks beside the reset
  retention, openclaw#203174's Responses-only signed selection with the fork's
  per-item answers, both port fixtures, both worker-path lists).
- update-cli tests (openclaw#200578 deleted the in-place Git runner): upstream's
  deletions win; the fork's compiler-flag argv matchers are carried onto
  upstream's rewritten checks.

Refs openclaw#129388

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant