Skip to content

fix(postgres): explain connection loss and canceled queries - #181576

Merged
steipete merged 17 commits into
mainfrom
pgprep/pgfix-outcomeux
Oct 23, 2026
Merged

steipete merged 17 commits into
mainfrom
pgprep/pgfix-outcomeux

Conversation

@steipete

@steipete steipete commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What problem this solves

PostgreSQL connection loss during chat or cron could surface an opaque operation/cleanup aggregate, a bare native-owner error, or a generic assistant failure. Native SQLSTATE 57014 cancellation could also become a provider error and allow model continuation.

Supersedes #179316. Prerequisites already merged: #181472 fixes implicit first-chat admission through symlinked state paths; #181546 documents timeout precedence; #181661 fixes the independently reproduced admission/recovery liveness bugs. Archive-alias work remains separate in #181554.

Root causes and fix

Canonical outcomes were lost at native-owner wrapping, worker hydration, the actor's name/message-only projection, and terminal flattening. Cleanup aggregates could obscure the operation's primary failure. Preserve canonical identity through these boundaries and use the existing shared guidance owner for chat, RPC, history, and cron.

  • Unknown outcomes explain that work may have been saved and direct the user to wait and check history before retrying. Existing canonical unavailable outcomes accurately explain a confirmed rollback, that nothing from that operation was saved, and that the user can retry.
  • Cleanup stays secondary. Uncertainty anywhere in the error graph continues to fence replay and model continuation, including after lossy stream projection and assistant re-entry. Ordinary tool failures and provider-only codes retain their existing behavior.
  • The PostgreSQL decoder identifies native 57014 cancellation. Canonical re-entry preserves that provenance without double-wrapping it as a provider failure.
  • Tool execution drains accepted work and preserves every failure before releasing custody. An admitted sequential streamed batch that resumes after its predecessor failed now releases its unlaunched admission before publishing skipped outcomes.
  • Already-classified terminal guidance is also emitted through the existing error payload when the model produced no final payload, preserving the existing fallback-settlement boundary.

No new public code, protocol shape, configuration option, observer reclassification, timeout, or retry/at-most-once policy. Existing progress/result helpers moved into their owning outcome/stream modules; no parallel presentation owner remains.

Evidence

Final head e30dfccfa102 passed the complete live gate with a real pnpm openclaw gateway run, a real model, and local Homebrew PostgreSQL 17.11 with pgvector 0.8.7; no Docker.

  • Chat termination: 3 waves × 16 accepted turns, all active at injection and all terminal with guidance on chat, history, and agent.wait. All 144 checked error surfaces had guidance; no opaque aggregate, bare native-owner-loss, or raw settlement headline.
  • Cron termination: 1/1 passed. pg_cancel_backend: 1/1 passed with cancellation guidance and correlated native SQLSTATE 57014. Earlier fixed8 qualification passed both 3/3.
  • All five fresh PostgreSQL recovery chats passed; Gateway PID 4709 survived throughout.
  • SQLite: 48 controls, cron and cancellation controls, and five fresh recoveries passed on unchanged Gateway PID 10053.
  • Both Gateways and throwaway PostgreSQL servers stopped. All 14 temporary probe paths were restored and independently hash-verified; no instrumentation is committed.

Owning-boundary regressions were RED before the repairs and GREEN afterward. The registered real-PG test terminates/cancels actual transcript-worker writes and checks typed outcomes and guidance through production chat/cron adapters (RED 2 / GREEN 2). Separate regressions cover confirmed-rollback presentation, whole-graph uncertainty, native cancellation provenance, ordinary failures, and no-replay assistant recovery. The last admission repair was RED with zero releases, then GREEN alongside 110 SDK/core controls. Types, lint, formatting, line-cap and import-cycle checks passed.

Actual-broker regressions were RED for canonical aggregate hydration and primary-outcome presentation, then GREEN with 89 transport/codec tests and 45 surface tests. Regressions for successful sibling finalization, canceled pre-execution hooks, and canonical unavailable transport were also RED, then GREEN with 101 agent-loop/SDK tests and 57 codec tests. Aggregate retry exclusion and ordinary provider behavior remain unchanged. The final committed-branch review is clean through P3 across all three passes. All three final-head PostgreSQL conformance shards executed and passed: 1,130 tests passed, with 37 existing conditional skips. Each raw shard log was inspected; outcome-surfaces.postgres.test.ts executed both termination and cancellation cases successfully in shard 1. Final-head CI run.

Production/runtime: 30 files, +1071/-536 (net +535), including one wrapper-inventory entry. Tests: 33 files, +2246/-146; one append-only PG registration. No healthy-path SQL or database request is added; no timing claim.

Investigation notes

The fixed2 stall was observed once (16/16 on one wave), not reproduced in exact fixed1/fixed2 replays or 48+ later turns. A later multi-wave stall reproduced on unmodified main and was traced to the admission/writer cycle fixed separately in #181661. Its repaired live gate passed 48/48 terminal faults, all recoveries, SQLite controls, and all three PostgreSQL conformance shards.

The macOS provisioner timeout was unrelated, macOS-only, and pre-existing. Its timeout was not increased. Selector misses, an earlier synthetic-marker mismatch, and an intermediate missing cancellation payload remain recorded as failed proof attempts; each qualifying result above came from a fresh complete replay.

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 23, 2026
@steipete
steipete marked this pull request as ready for review October 23, 2026 10:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T17:06:28.039359Z e30dfcc 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.

@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: e2d138cdb3

ℹ️ 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".

@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. labels Oct 23, 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: 5a7f7f2a0a

ℹ️ 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 packages/agent-core/src/agent-loop.ts Resolved
Comment thread src/infra/sqlite-error-diagnostics.ts Resolved
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR preserves PostgreSQL connection-loss and cancellation outcomes through workers, tools, chat, history, and scheduled-run error messages.

Example: PostgreSQL cancels a chat database operation with SQLSTATE 57014.

  • Before: The cancellation can become a tool error that lets the assistant continue.
  • After: The application stops continuation and asks the user to check completed work before trying again.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The repair has clear value and substantial boundary coverage, but confirmed cleanup and packaging defects prevent merge; raw live traces were not supplied for inspection.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor-proof gate; its body records PostgreSQL 17 fault drills through the real Gateway CLI and model, while the inspectable regression source exercises actual PostgreSQL faults through worker writes and chat/cron adapters.
Patch quality 🦪 silver shellfish (2/6) 5 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Database interruptions can expose internal diagnostics or let the assistant continue without explaining uncertain completed work.
Reason: The maintainer-authored direction repairs established recovery behavior through existing owners without adding configuration or replay policy.

Merge readiness

⛔ Needs changes before merge - 5 items remain

Keep this PR open: the maintainer-approved repair addresses a current storage-error gap, but five actionable defects remain before merge.

Priority: P2
Reviewed head: 5a7f7f2a0a4627a4dad8be4e86ce1e12cb12626f

Before merge

  • Release admitted calls when local preparation throws (P2) - With loop detection enabled, beforeToolBatch records admission markers before the internal preparer runs. If that preparer throws a newly classified storage cancellation or unknown-outcome error, this rethrow bypasses every releaseSkippedCalls path. executeToolCallGroups only disposes prepared executions, and local errors also bypass agent_end, the embedded run's fallback cleanup. Release the failing call and all other unlaunched admissions before propagating the error so repeated storage failures do not accumulate entries in the process-global admission set.
  • Release the sequential tail after a started local failure (P2) - For a sequential batch containing two admitted calls, let the first tool start and later reject with a PostgreSQL cancellation. Launch has already completed when the rejection is observed here, so fatal was unset at the earlier release block. The remaining call receives a synthetic skipped result without releasing its admission marker, and the propagated local failure bypasses agent_end cleanup. Release the unstarted tail when settlement establishes fatal, while continuing to drain already started work.
  • Guard inspection of error causes (P2) - An Error with a throwing cause getter now throws from this loop increment instead of producing a classification. This classifier runs while constructing Gateway, failover, and terminal responses, so the accessor exception replaces the original failure and can prevent a stable response. The AggregateError branch also directly evaluates cause and errors. Use guarded property reads or data descriptors throughout the added traversal, preserving the existing error-coercion boundary's handling of inaccessible causes.
  • Include the extracted error module in the PR wrapper inventory (P2) - The new re-export makes sqlite-worker-error.ts a runtime dependency of the source subset extracted by scripts/pr, but scripts/pr-lib/wrapper-components.txt still includes only the former contract module. Exact-head CI confirms both the missing inventory entry and a copied wrapper failing with Cannot find module '../../infra/sqlite-worker-error.js'. Add the leaf module to that inventory so lease bootstrap and other wrapper operations can load their extracted source.
  • Update the dispatcher regression for uncertainty precedence (P2) - Returning reconciliation before inspecting concrete storage causes changes the dispatched disk-full worker response for an unknown settlement. The existing authenticated-request-dispatch.storage.test.ts still expects SQLITE_FULL and disk-space guidance for both dispatched and queued failures, and exact-head CI fails that assertion. Update the unknown-settlement case to expect reconciliation guidance while retaining the queued, unexecuted case's disk-full classification and retryability checks.

Findings

  • [P2] Release admitted calls when local preparation throws — packages/agent-core/src/agent-loop-tool-execution.ts:208-209
  • [P2] Release the sequential tail after a started local failure — packages/agent-core/src/agent-loop.ts:726-729
  • [P2] Guard inspection of error causes — src/infra/sqlite-error-diagnostics.ts:46-54

Tests

  • Missing end-to-end proof: The body reports successful real Gateway/model fault drills, but supplies no linked raw trace; the added tests do not cover the two admission-cleanup failures identified here.
Agent review details

How this fits together

Native database errors cross worker and session-actor boundaries into agent execution; shared classification and rendering produce Gateway responses, chat guidance, and cron summaries.

flowchart TD
  A[PostgreSQL operation] --> B[Worker error transport]
  B --> C[Session actor and native owner]
  C --> D[Agent and tool execution]
  D --> E[Shared storage classification]
  E --> F[Chat and history guidance]
  E --> G[Cron terminal summary]
Loading

Technical review

Best possible solution:

Keep the existing classification and lifecycle owners, release unlaunched admissions on every new error exit, and complete the wrapper and consumer-test cutover.

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

Current-main source shows the missing cancellation provenance and outcome classification, and the PR records real PostgreSQL fault reproduction; this read-only review ran no target code.

Is this the best way to solve the issue?

Preserving typed outcomes through the existing owners is the smallest complete approach, but the new exceptional exits must settle their admission bookkeeping and all consumers must follow the cutover.

Full review comments:

  • [P2] Release admitted calls when local preparation throws — packages/agent-core/src/agent-loop-tool-execution.ts:208-209
    With loop detection enabled, beforeToolBatch records admission markers before the internal preparer runs. If that preparer throws a newly classified storage cancellation or unknown-outcome error, this rethrow bypasses every releaseSkippedCalls path. executeToolCallGroups only disposes prepared executions, and local errors also bypass agent_end, the embedded run's fallback cleanup. Release the failing call and all other unlaunched admissions before propagating the error so repeated storage failures do not accumulate entries in the process-global admission set.
    Confidence: 0.99
  • [P2] Release the sequential tail after a started local failure — packages/agent-core/src/agent-loop.ts:726-729
    For a sequential batch containing two admitted calls, let the first tool start and later reject with a PostgreSQL cancellation. Launch has already completed when the rejection is observed here, so fatal was unset at the earlier release block. The remaining call receives a synthetic skipped result without releasing its admission marker, and the propagated local failure bypasses agent_end cleanup. Release the unstarted tail when settlement establishes fatal, while continuing to drain already started work.
    Confidence: 0.99
  • [P2] Guard inspection of error causes — src/infra/sqlite-error-diagnostics.ts:46-54
    An Error with a throwing cause getter now throws from this loop increment instead of producing a classification. This classifier runs while constructing Gateway, failover, and terminal responses, so the accessor exception replaces the original failure and can prevent a stable response. The AggregateError branch also directly evaluates cause and errors. Use guarded property reads or data descriptors throughout the added traversal, preserving the existing error-coercion boundary's handling of inaccessible causes.
    Confidence: 0.98
  • [P2] Include the extracted error module in the PR wrapper inventory — src/infra/sqlite-worker-contract.ts:15-21
    The new re-export makes sqlite-worker-error.ts a runtime dependency of the source subset extracted by scripts/pr, but scripts/pr-lib/wrapper-components.txt still includes only the former contract module. Exact-head CI confirms both the missing inventory entry and a copied wrapper failing with Cannot find module '../../infra/sqlite-worker-error.js'. Add the leaf module to that inventory so lease bootstrap and other wrapper operations can load their extracted source.
    Confidence: 1
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Update the dispatcher regression for uncertainty precedence — src/infra/sqlite-error-diagnostics.ts:60-61
    Returning reconciliation before inspecting concrete storage causes changes the dispatched disk-full worker response for an unknown settlement. The existing authenticated-request-dispatch.storage.test.ts still expects SQLITE_FULL and disk-space guidance for both dispatched and queued failures, and exact-head CI fails that assertion. Update the unknown-settlement case to expect reconciliation guidance while retaining the queued, unexecuted case's disk-full classification and retryability checks.
    Confidence: 1
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 054f11c8cc68.

Provenance checked

  • Shared storage classification and rendering keeps the original intent (c91b1ea: Classify native storage errors before flattening and render consistent recovery guidance without automatic replay or provider credential rotation.)
  • Concrete-cause priority versus unknown settlement changes intended behavior with a stated reason (36069eb: Retain initiating storage causes through worker and actor envelopes and prefer concrete recovery guidance; this PR deliberately makes canonical uncertainty primary while keeping cleanup diagnostic.)
  • Ordered parallel tool launch and settlement keeps the original intent (48c9397: Use one tool driver while preserving synchronous admission, ordered results, cancellation, and overlapping started work.)
  • Canonical worker error ownership keeps the original intent (e180460: Retain canonical worker classification through cleanup errors and module copies without treating arbitrary code fields as retry authority.)
  • Retained read-only connections keeps the original intent (63b1488: Reuse the existing read-only connection scope while preserving snapshots, authorization, and lifecycle ownership.)
  • Native preparation and caller authority keeps the original intent (03e18cf: Keep caller authority current without allowing cancelled or refused openers to poison healthy borrowers.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/plugin-sdk/agent-core.outcomes.test.ts src/agents/tool-loop-admission.test.ts --maxWorkers=1
  • pnpm test src/gateway/error-shape.test.ts src/gateway/server/ws-connection/authenticated-request-dispatch.storage.test.ts --maxWorkers=1
  • pnpm test test/scripts/pr-wrapper-source-closure.test.ts test/scripts/eager-import-closure.test.ts --maxWorkers=1
  • Verify the new cleanup and accessor regressions fail on the reviewed head and pass with the repair.
  • Require the affected exact-head CI checks and PostgreSQL conformance landing gate to complete.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c91b1ea adds src/agents/failover/assistant-request-failure-copy.ts:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c91b1eaab768; files: src/agents/failover/assistant-request-failure-copy.ts)
  • Vincent Koc: Raw commit d0b48d6 adds src/agents/failover/assistant-request-failure-copy.ts:38 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: d0b48d63efb8; files: src/agents/failover/assistant-request-failure-copy.ts)

PR surface

Source +181, Tests +1020. Total +1201 across 56 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 24 464 283 +181
Tests 32 1093 73 +1020
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 56 1557 356 +1201

Root-cause cluster

Relationship: canonical
Canonical: #181576
Summary: This PR replaces the narrower resolver-only proposal after live replay exposed additional error-loss boundaries.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: This repairs recovery guidance and continuation handling for database interruptions with a limited, identifiable blast radius.
  • add merge-risk: 🚨 compatibility: The exported SDK Agent now propagates canonical storage failures instead of converting them into ordinary tool results; this is a maintainer-approved repair using the existing hook and unchanged signatures.
  • add merge-risk: 🚨 automation: The extracted runtime dependency is absent from the PR wrapper inventory, and exact-head CI demonstrates a wrapper module-load failure.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This repairs recovery guidance and continuation handling for database interruptions with a limited, identifiable blast radius.
  • merge-risk: 🚨 automation: The extracted runtime dependency is absent from the PR wrapper inventory, and exact-head CI demonstrates a wrapper module-load failure.
  • merge-risk: 🚨 compatibility: The exported SDK Agent now propagates canonical storage failures instead of converting them into ordinary tool results; this is a maintainer-approved repair using the existing hook and unchanged signatures.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 23, 2026, 7:25 AM ET / 11:25 UTC.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 23, 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: a1b3aa9ef0

ℹ️ 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 packages/agent-core/src/agent-loop.ts Resolved

@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: 8657c98cd1

ℹ️ 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/infra/sqlite-error-diagnostics.ts Resolved

@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: 5eede8c604

ℹ️ 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".

@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: a6b81da844

ℹ️ 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 packages/agent-core/src/agent-loop.ts Resolved

@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: 6af367671d

ℹ️ 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 packages/agent-core/src/agent-loop.ts Resolved

@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: 8b61acb917

ℹ️ 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".

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The actionable findings are repaired on d59f498, including local outcome-hook failures, rollback provenance, skipped streamed-batch admission, broker aggregate hydration, and primary aggregate uncertainty guidance. The unsupported throwing-prototype edge case was explicitly declined in its thread. All reviewed threads have replies and are resolved.

The final complete Codex review is clean through P3 across three passes. Final real-Gateway PostgreSQL and SQLite live qualifications passed, including all 48 faulted PostgreSQL turns, cron termination, native cancellation, fresh recoveries, and unchanged PIDs. All temporary probes were restored. Final-head CI is still running; landing waits for the required checks and all three PostgreSQL conformance logs.

@clawsweeper

clawsweeper Bot commented Oct 23, 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-repro Preliminary submission classification; full source review pending. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@steipete
steipete merged commit 697b23a into main Oct 23, 2026
180 checks passed
@steipete
steipete deleted the pgprep/pgfix-outcomeux branch October 23, 2026 17:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 23, 2026
…vers (#181806)

#181576 used Promise.withResolvers in agent-core's tool-batch launcher, but the package declaration build compiles against the repo's ES2023 lib, so pnpm build failed on main with TS2550 and produced no artifacts. Capture the resolver from a plain promise instead (the executor runs synchronously, and only resolve is used); behavior is identical and the package lib target stays unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
…#181576)

* fix(postgres): explain connection loss and canceled queries

* fix(storage): separate canonical worker error ownership

* fix(build): include worker error owner in PR wrapper

* test(gateway): assert outcomes for uncertain write RPCs

* fix(agents): release unstarted calls after storage failures

* fix(agents): release canceled calls when settlement fails

* fix(storage): inspect cancellation markers without getters

* fix(agents): preserve tool outcomes through diagnostic inspection

* fix(postgres): explain known rollback outcomes

* fix(agents): retain primary outcomes through accepted work cleanup

* fix(agents): publish storage guidance with terminal error payloads

* fix(agents): retain outcomes through hooks and error projections

* fix(agents): honor storage outcomes before transient recovery

* fix(agents): release batches skipped after predecessor failure

* fix(storage): hydrate canonical aggregate outcomes at broker

* fix(storage): retain primary aggregate uncertainty guidance

* fix(postgres): retain successful settlement and rollback outcomes
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
…vers (openclaw#181806)

openclaw#181576 used Promise.withResolvers in agent-core's tool-batch launcher, but the package declaration build compiles against the repo's ES2023 lib, so pnpm build failed on main with TS2550 and produced no artifacts. Capture the resolver from a plain promise instead (the executor runs synchronously, and only resolve is used); behavior is identical and the package lib target stays unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts 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.

1 participant