Skip to content

fix(state): messages to agents fail right after a Gateway restart instead of waiting - #174958

Merged
steipete merged 30 commits into
mainfrom
codex/stab-startup-admission-wait
Oct 19, 2026
Merged

steipete merged 30 commits into
mainfrom
codex/stab-startup-admission-wait

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Messages and new sessions can fail immediately after a Gateway restart while their selected agent is still preparing. TUI and Control UI requests now wait up to five minutes for that agent, while ready agents proceed independently. The Gateway refuses startup writes before handler dispatch; the existing client request owner retries only the matching method-bound refusal with the original frame, deadline, and cancellation signal. Inspection and ownership failures remain errors.

The durable cron worker owns queue order, capacity, and receipt custody. Readiness wakes its queue without taking the event or occupying a running slot. Readiness capture, observation, and final admission use the service environment, including a distinct state directory. The maintainer decisions remain “Wait for that agent”, “Readiness handoff” for cron, and “Longer UI waits”. The separate #176685 issue is not a blocker.

Stop cancels unsent or authoritatively refused startup work. Once a creation or send is dispatched, the client retains its result under the original operation and idempotency key. This covers TUI typed Stop/Abort, Control UI chat/steer/placement sends, and shared creation callers including Workshop and MCP. Presentation cancellation does not imply server cancellation; late successes reconcile through the existing owners. No configuration option, schema, wire field, or new retry owner is added.

Current head: bbddb3037f6e5d64087d706f8a13c6dc2bc1ca66. The latest repair keeps startup-refused writes eligible for suspension pause/resume and clears delivery uncertainty after authoritative non-delivery. It also releases a Gateway-wide recovery probe when that probe reaches an agent-local startup refusal, allowing ready agents to progress independently. The existing probe revision prevents an older reply from releasing a newer suspension.

Evidence

The two-agent recovery regression fails on affb6dbb9d8f because the ready agent's frame is never sent; the newer-suspension control passes. The focused repair passes all 48 pending-request/protocol cases, the affected package test-type graph, scoped lint, formatting, and whitespace checks. Independent review through P2 found no actionable issues. The exact delayed-response TUI diagnostic passes after the repair: no early settlement or false cancellation, first success adopted, one creation and one key. Focused client tests take 6.14 seconds wall time; the TUI diagnostic takes 64.93 seconds including runtime preparation (44 ms test body).

Earlier exact-head proof covers 283 gateway-client, 239 TUI, 795 UI, and 11 browser cases, plus types, lint and import cycles; counts overlap. Final-head CI passes Control UI performance at Chat 1,454,997 B and New Session 1,012,108 B gzip, both below the original 1,490,000 / 1,050,000 B ceilings. No performance budget was changed.

The previous X-publication child-transcript timeout remains intermittent and unexplained: one local failure followed by two passing replays, while the matching main test passed. On affb6dbb9d8f, the exact CI case passes in 7.9 seconds. That pass is evidence of intermittency, not a causal repair. Synthetic transport tests exercise production owners but do not establish a live-provider or durable external server-write result. Finite sent deadlines and disconnect uncertainty remain unchanged.

CI 39238871915 completed successfully on the prior affb6dbb9d8f head. Revision 17 on the probe-repair head reported no actionable findings or security issue, with a merge conflict as its remaining requirement. The current signed merge incorporates main c0498d39fbb9: both appended runtime-module groups are retained and the boot manifest is regenerated for main’s layout helper. The merged tree passes 19 wrapper-closure cases, 48 client cases, the delayed-response TUI diagnostic, core types, and full-candidate independent review through P2. Final exact-head CI 39243302011 passed with 103 successful jobs and 19 skipped. ClawSweeper revision 18 found no correctness or security issue and no remaining before-merge item. The final X-publication case passed in 11.9 seconds; the historical intermittent timeout is not claimed causally repaired.

Join each agent's existing startup completion before admitting writes, with
bounded slow-host/fleet budgets and request or Gateway cancellation. Keep
terminal inspection refusals and read behavior intact, and prepare session
storage before authorization acquires mutation facts.

Keep cron requests queued until their agent is admitted, without consuming
running capacity or transferring source custody. Wake the native queue after
preparation and retain its ordinary eligibility, ordering, and capacity checks.

Prove pending writes wait and that eight preparing cron jobs leave capacity
for a healthy agent; update startup RPC recovery to await the same request.
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 17, 2026
@github-actions

github-actions Bot commented Oct 17, 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: bbddb3037f6e5d64087d706f8a13c6dc2bc1ca66
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/server-methods/request-authorization.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

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: 6896de1993

ℹ️ 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/cron/service/run-queue.ts Outdated
const run = () => launchCronRun(state, entry, launch);
const run = async () => {
if (preparation) {
await waitForAgentDatabaseWriteAdmission(preparation.agentId, {

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 Keep timed-out cron preparations queued

When an agent's startup preparation exceeds the bounded write-admission timeout (five minutes plus the queued-batch allowance), this await rejects with AgentDatabaseAdmissionError; the generic rejection handler below then calls cancelCronRunRequests, converting the durable queued occurrence into skipped history. Consequently, a slow but ultimately successful startup permanently loses scheduled runs—and rejects manual runs—instead of waking the retained receipt when admission completes. Cron should join the underlying preparation without the request timeout, or treat this timeout as a reason to leave the receipt queued.

AGENTS.md reference: AGENTS.md:L107-L107

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-19T11:21:08.999471Z bbddb30 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.

@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. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes interactive requests wait for their selected agent’s startup preparation and keeps scheduled work queued until that agent is ready.

Example: Agent main takes 45 seconds to prepare after restart while a user submits “Summarize notes.”

  • Before: The request fails during preparation and requires another submission.
  • After: The client retains the original request and dispatches it once after main becomes ready, unless canceled or expired.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and the prior defects are repaired, with confidence supported by owner-boundary regressions rather than a shipped startup-recovery demonstration.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied diagnostics exercise production owners with synthetic transport, while the inspected images establish only predecessor offline behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Messages, new sessions, and scheduled work fail while their selected agent is still preparing after a Gateway restart.
Reason: The failure has concrete source and operator evidence, and the maintainer explicitly approved the wait and readiness-handoff direction.

Merge readiness

✅ Ready for maintainer review

This PR addresses a concrete startup failure that remains on main; no actionable correctness or security findings remain in this review, and GitHub confirms the conflict is resolved.

Priority: P1
Reviewed head: bbddb3037f6e5d64087d706f8a13c6dc2bc1ca66

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied scenario demonstrates two-agent recovery, cancellation, and a confirmed message or session result through an isolated shipped Gateway and client.
Agent review details

How this fits together

Gateway startup prepares agent databases independently; request admission and the durable cron queue consume readiness before allowing session mutations or agent execution.

flowchart TD
  A[UI or TUI request] --> B[Shared pending request owner]
  B --> C[Gateway admission and authorization]
  D[Agent startup preparation] --> C
  C --> E[Session or agent handler]
  D --> F[Durable cron queue]
  F --> G[Existing cron launcher]
Loading

Technical review

Best possible solution:

Retain the shared admission, request-settlement, and durable queue owners with the approved bounded interactive waits.

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

Current-main request behavior and the release report establish the failure path; no target code or reproduction was executed during this read-only review.

Is this the best way to solve the issue?

The repair uses the existing readiness, retry, cancellation, and queue owners, preserves pre-dispatch refusal, and reconciles dispatched outcomes instead of adding competing retry machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 37642c04282e.

Provenance checked

  • Background agent preparation keeps the original intent (ec9de37: Allow the Gateway and healthy agents to operate while slow inspection continues, without admitting ordinary writes prematurely.)
  • Per-agent preparation completion keeps the original intent (8e3c6be: Join the exact agent’s preparation before inbound replay and session writes while preserving cancellation and independent agent progress.)
  • Gateway-wide recovery probe keeps the original intent (d51345a: Reduce reconnect bootstrap storms using one revision-bound probe while allowing recovery after a rolled-back fence.)
  • Interactive acknowledgment deadline changes intended behavior with a stated reason (fix(ui): keep chat and drafts usable when connections fail #162428: Bound acknowledgment waits and reconcile uncertain writes; the approved longer UI wait preserves a finite original deadline.)
  • Durable cron launch ownership keeps the original intent (0973bef: Keep queue order, capacity, activation, and recovery under the SQLite worker, with a host launcher checking current eligibility.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned head and resolved conflict: REST inspection confirmed head bbddb30 is mergeable; the CI gate remains pending and the inspected check pages reported no failures. (bbddb3037f6e)
  • Safe retry boundary: The router marks preparing-agent refusals before handler dispatch; the pending-request owner retries only the matching method before acceptance and preserves the existing pause revision. (packages/gateway-client/src/pending-request.ts:313, bbddb3037f6e)
  • Cron custody and capacity: Preparing agents remain in the existing durable queue before capacity is consumed; readiness observations use the service environment and wake the same queue owner. (src/cron/store/run-queue.worker.ts:376, bbddb3037f6e)
  • Recorded owner direction: The maintainer request and discussion explicitly retain agent-specific waits, cron readiness handoff, and longer UI waits; the five-minute interactive limit is an accepted product choice. (bbddb3037f6e)
  • Affected release report: JoPaMu’s discussion reports pending agent admission failing a scheduled one-shot on v2026.10.4 before its acceptance work could execute, supporting the need for readiness-based queue handoff.
  • Related narrow fix: fix(gateway): refuse sends before agent database admission #176685 merged agent-only external-send admission; it does not provide this PR’s broader client waits, cancellation reconciliation, or cron readiness handoff. (src/gateway/server-methods/request-authorization.ts:299, d81190a16e01)

Likely related people:

  • Peter Steinberger: Raw commit ec9de37 adds src/state/agent-database-startup.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ec9de3781828; files: src/state/agent-database-startup.ts)
  • ruel225: Raw commit 520860b adds src/state/agent-database-startup.ts:433 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 520860b45bbe; files: src/state/agent-database-startup.ts)
  • weiqinl: Raw commit bcd4ccc adds src/state/agent-database-startup.ts:500 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: bcd4ccc17f25; files: src/state/agent-database-startup.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Interactive response deadline 30 seconds → 300 seconds TUI and Control UI creation/send requests receive the approved startup wait while SDK callers retain their own deadlines.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove merge-risk: 🚨 message-delivery: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: Restart-time admission failures interrupt real agent messages and scheduled work, including an operator-reported affected release.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦪 silver shellfish.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • For stronger confidence, demonstrate two-agent startup recovery through an isolated shipped Gateway and client, including cancellation and one confirmed message or session result.

Rating scale

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

Workflow

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

History

Review history (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-19T02:15:10.975Z sha b86fbe2 :: needs changes before merge. :: none
  • reviewed 2026-10-19T05:18:59.222Z sha 62ca266 :: needs changes before merge. :: [P1] Preserve reconciliation after a dispatched create is aborted | [P2] Synchronize palette ownership tests with creation dispatch
  • reviewed 2026-10-19T06:17:27.393Z sha 75969f0 :: needs changes before merge. :: [P2] Retain dispatched creation outcomes in the sibling callers | [P2] Update the shared attachment submission expectation | [P2] Restore New Session's unchanged boot-byte ceiling
  • reviewed 2026-10-19T07:08:14.728Z sha 6aae8bf :: needs maintainer review before merge. :: none
  • reviewed 2026-10-19T08:19:55.234Z sha 3b70614 :: needs changes before merge. :: [P1] Scope cron readiness to the service environment | [P2] Narrow the TUI fixture's first write before dereferencing it | [P2] Align the new chat fixture with current-main element ownership | [P2] Update the placement Retry assertion for sent-result retention | [P2] Keep the timeout error import inside the wrapper's narrow closure
  • reviewed 2026-10-19T10:00:06.708Z sha 0f4737d :: needs changes before merge. :: [P2] Keep startup-refused writes eligible for pause and resume | [P2] Clear delivery uncertainty after a pre-dispatch refusal
  • reviewed 2026-10-19T10:46:24.907Z sha affb6db :: needs changes before merge. :: [P2] Release the recovery probe on an agent-local startup refusal
  • reviewed 2026-10-19T11:10:16.423Z sha 8a1b1f4 :: needs changes before merge. :: none

Reviewed October 19, 2026, 7:23 AM ET / 11:23 UTC (Revision 18).

Keep cron readiness on startup's lifetime-cancelled preparation observation,
independently of the bounded foreground request budget. Preserve terminal
admission refusals and leave queued receipts recoverable on lifecycle shutdown.

Merge current main while retaining its resident-store reuse assertion. Cover
readiness beyond the request budget, terminal failures, and service/Gateway
shutdown through the real startup and native queue owners.

Refs: #174958
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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: 0f4737daa9

ℹ️ 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 +273 to +277
pending.retryStartup = (retryAfterMs) => {
clearTimeout(startupRetry);
startupRetry = setTimeout(
send,
resolveFiniteTimeoutDelayMs(retryAfterMs, GATEWAY_SUSPEND_IDENTITY_RETRY_AFTER_MS),

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 Keep startup-retry writes resumable during Gateway pauses

When a write has received the method-marked startup refusal and a suspension or restart begins before this retry timer fires, retryStartup invokes send without making the request eligible for pending.resend. The retry therefore ignores bootstrapPause, and a subsequent gateway-suspending or gateway-restarting refusal falls through as a terminal error instead of resuming after the Gateway returns to accepting, even though the first refusal proved that the write was never dispatched. Keep startup-refused writes pause/resume eligible until they settle.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

Comment on lines +605 to +607
timeoutMs: GATEWAY_STARTUP_ADMISSION_WAIT_MS,
signal: context.runRequest?.signal,
retainSentResultOnAbort: true,

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 Retain steer commands for the full startup budget

After a restart, when /steer or /redirect targets an agent in a later inspection batch, this fixed 300,000 ms deadline can expire while waitForAgentPreparation() still permits five minutes plus one minute per queued batch. The command is then reported failed and is not resumed when preparation finishes. This newly added slash-command path is separate from the previously reported ordinary chat-send deadline; use the full admission budget or let the existing lifecycle signal govern it.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

Keep startup-refused writes in the existing suspension pause/resume path
without changing their serialized frame, cancellation or deadline. Clear
send uncertainty when an authoritative refusal proves non-delivery, and
restore it only when the request dispatches again.

Cover suspension and restart handoff, synchronous refusal, deadline expiry
before retry and delivery uncertainty after redispatch.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review exact head affb6dbb9d8ffc39389c769b2470ac74331c4c45. The revision 15 findings are repaired in the shared pending-request owner: authoritatively startup-refused writes retain pause/resume eligibility, and pre-dispatch refusal clears delivery uncertainty while preserving the serialized frame and original deadline. New owner regressions fail before the repair and pass after it; gateway-client, TUI, UI, browser, type/lint and bundle checks pass as detailed in the repair evidence. The original Chat and New Session gzip ceilings remain unchanged.

CI run 39238871915 is running on this exact head. The prior X-publication child-transcript timeout is intermittent and unresolved; a recurrence on this head will stop landing. The accepted directions remain “Wait for that agent”, “Readiness handoff” for cron, and “Longer UI waits”.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

An agent-local startup refusal proves the Gateway-wide recovery fence no
longer blocks dispatch. Release the current probe so a ready agent can
continue while the slow agent retains its own original request and retry.
Keep newer suspension announcements fenced by the existing revision.

Cover two-agent rollback recovery and a newer-announcement control through
the pending-request owner. Preserve original frames, deadlines and aborts.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review exact head 8a1b1f486e60d2befa328237630c5bbe9fed7b45. Revision 16's recovery-probe defect is repaired: an authoritative agent-local startup refusal releases the current Gateway-wide recovery probe; the existing revision check preserves any newer suspension. Per-agent retries keep their original frame, deadline and cancellation signal.

The two-agent regression fails on affb6dbb9d8f (ready agent never sends), while its newer-suspension control passes. Both pass with the repair; all 48 pending-request/protocol cases, affected package test types and scoped lint pass. The delayed-response TUI diagnostic also passes after the repair with one creation/key and retained late success. Independent correction review through P2 is clean.

Prior-head CI 39238871915 completed successfully, including the formerly intermittent X-publication case. That remains intermittency evidence, not a claimed X fix. Fresh exact-head CI is required for this seven-line production repair. The accepted agent-specific wait, cron readiness handoff and longer UI wait decisions remain unchanged.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Merge current main to resolve the runtime-wrapper inventory conflict.
Keep the startup wait modules and main's MCP owner modules, and regenerate
the Control UI boot manifest for main's reachable layout helper.

The merged candidate passes wrapper-closure, pending-request, protocol and
TUI settlement tests, plus core types. Keep per-agent recovery probes,
original request deadlines, and late-result custody unchanged.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review exact head bbddb3037f6e5d64087d706f8a13c6dc2bc1ca66. Revision 17 reported no actionable findings or security issue on the probe repair and requested conflict resolution. This signed merge incorporates main c0498d39fbb9, retaining both appended runtime-module groups in the wrapper inventory and regenerating the boot manifest for main's reachable layout helper. No production-code conflict required a manual resolution. GitHub now reports mergeable.

Merged-candidate proof passes: 19 wrapper-closure cases, 48 pending-request/protocol cases, the exact delayed-response TUI diagnostic (one creation/key and retained late success), and core types. Full-candidate independent review through P2 is clean. Original deadlines, cancellation, per-agent progress and cron readiness custody remain unchanged. Fresh exact-head CI is starting; prior-head CI 39238871915 passed including X-publication, with the earlier intermittency still recorded rather than claimed fixed.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@JoPaMu

JoPaMu commented Oct 19, 2026

Copy link
Copy Markdown

Additional operator evidence from 2026.10.4 (383c124), macOS/launchd, observed on 2026-10-19. This supports the need for a per-agent readiness handoff rather than a longer fixed startup delay.

Two one-shot at + agentTurn jobs with sessionTarget: "current" and required announce delivery were intended to perform post-restart acceptance work:

Case Observed sequence (Europe/Berlin) Native run outcome
Restart interruption Run started 11:12:30.039; its run-history error was finalized at 11:15:21.707; replacement Gateway process started 11:15:33 error, completion failed, Gateway restarting., delivery unknown
Pending agent admission Replacement process started 12:21:39; job scheduled 12:22, actually attempted 12:25:50.170 Failed after 148 ms, before acceptance-test work, with Agent main has not completed startup inspection and preparation. The 5 second foreground startup budget elapsed; inspection continues.; completion failed, delivery unknown

For the second case, the Gateway logged startup phase ready at 12:23:43.317, but requests for main were still refused with that pending-inspection error through at least 12:33:12.220. The five seconds in the error are the foreground inspection budget, not this job's timeout. A readiness/process guard in the agent prompt cannot help if preparation rejects the run before that prompt executes.

Both one-shots were subsequently found disabled without a confirmed success/blocker result in their originating conversation. Acceptance work was completed manually later. Deleted job definitions were not recreated: retained native automations runs --all history supplied these observations.

We also isolated the installed retry policy without importing the runtime or touching a live scheduler: the exact pending-inspection text and Gateway restarting. do not match the transient categories in resolveCronExecutionRetryHint; the first one-shot failure is consequently classified as permanent error. Twelve small source-extraction probes passed, including timeout/typed-reason positive controls and pending-vs-confirmed-failure admission controls. These are policy probes, not a live restart end-to-end test.

Release-source check: src/cron/retry-hint.ts is byte-identical between v2026.10.4 (383c124cc32ffee3f8e56f549b88da94d269a4af) and v2026.10.5 (1b58cb9a1b4f4353e1add63c8506db4d890962e8). The 10.5 source does contain the terminal-one-shot owner-repair change associated with #169102 and typed restart-abort production changes associated with #170162. We have not installed or live-tested 10.5, and are not claiming those partial fixes provide the readiness handoff here. The complete historical per-job failure-alert overrides were not retained, so we do not claim to have reconstructed every notification-routing detail.

Suggested regression coverage for the existing owner: pending preparation outlasting any fixed delay, exactly one dispatch when that agent becomes ready, permanent inspection/ownership failure staying terminal, and another restart while waiting retaining custody. Restart after execution or uncertain side effects must not be treated as an unconditional safe replay. No local product patch was installed for this investigation.

@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

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 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. docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants