Skip to content

fix(agents): preserve model ownership across Codex chat turns - #136754

Merged
steipete merged 5 commits into
mainfrom
steipete/elastic-grothendieck-ef4aef
Sep 3, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/elastic-grothendieck-ef4aef

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #118642 — native catalog continuation resolves the outer default model instead of the native snapshot model. Reported by @RothElektronik.

Additional instructions

Allow edits from maintainers is enabled by using a branch in the canonical repository.

What Problem This Solves

Fixes an issue where users continuing explicit, model-locked Codex model chats could fail before sending a request when their authored transport controls required OpenClaw's lossless runtime fallback. Recording the runtime that produced a reply could also misclassify the next turn.

Imported native sessions had a related ownership failure: a working native connection could be blocked by an unrelated host-provider credential warning, and the session could report the outer default model instead of its native selection. A separate response finalizer could then be mistaken for a session model switch.

Why This Change Was Made

Requested runtime, observed producer, concrete model locking, native model ownership, and native authentication are different facts. One synchronous, generation-checked private-binding read now serves execution preparation and session metadata; lease, mutation, and authentication machinery stay with their existing owners. Native selection remains separate from response and billing attribution through finalization, accounting, and queued follow-ups.

Host-auth native runs prepare credentials and authored controls for the actual private provider/model tuple, then recheck it before dispatch, connection, under the binding lease, and after resume before inference. Native-auth supervision retains its own connection and may follow native model changes. The existing fork/start native snapshot materializer is preserved.

User Impact

Concrete model chats retain their selected model, requested runtime, plugin owner, and real authored Responses parameters across turns, even when OpenClaw produces the response. Native sessions can continue without an unrelated host-provider key or a matching outer default model.

Session metadata omits inapplicable host-auth availability fields only for the native session's rendered model. It does not claim native credentials are ready, mutate shared model availability, or fabricate a missing catalog row. A pending native branch may show the configured placeholder until its first turn establishes the actual tuple.

Automatic host profile retry remains distinct from strict authored profile locks. Missing/changed ownership fails closed without replacing the native thread; incomplete host-auth tuples cannot borrow the outer model. No configuration option, dependency update, storage schema, persisted ownership mirror, or Gateway protocol schema is added.

The sidebar + terminal change in #136230 — open native CLIs from Codex and Claude catalog groups — remains separate and is preserved. The separate tool-only/empty-answer native-finalizer implementation is not imported here.

Evidence

Real before/after behavior

Source-built Gateways, the real dashboard composer, real OpenAI inference, and pinned Codex 0.152.1 were used with fresh isolated state/native homes and nonoperator ports. No operator Gateway/state, mock provider, database mutation, host-auth substitution, or UI bypass was used.

Scenario Untouched baseline Repaired candidate
Explicit concrete Codex model chat Both turns rejected by the false pinned-harness assertion before inference Both HTTP 200 Responses calls completed; second recalled ORBIT-CEDAR; both outgoing requests retained context_management and store=true
Native continuation, native model listed by host Both composer attempts blocked by missing host credentials despite a successful native seed Both turns completed, recalled imported NATIVE-ORBIT, and kept the native provider/model
Native continuation, native model unlisted by host Earlier native reproduction established outer-model/auth misclassification Both turns completed without inventing a model catalog row

After each concrete turn, durable requested runtime remained codex, observed producer was openclaw, and concrete model/owner/lock were unchanged. After every native turn, private binding, durable session and sessions.list agreed on openai/gpt-5.6-luna; native credential bytes, source history, source lineage and canonical thread stayed unchanged. Host auth profile stores remained empty. All six turns emitted final chat events and visibly rendered their expected answers.

All before/after screenshots and complete recording contact sheets were inspected and contain only synthetic conversations and the isolated app. Inspected media: concrete before/after and native before/after. The three exact-head candidate recordings are 12.12 seconds (concrete), 10.68 seconds (listed native) and 8.32 seconds (unlisted native). All owned Gateway/native processes were stopped and ports released.

Regression and static proof

The integrated ownership/accounting/Gateway/Codex/caller selection passed 2,458 tests across 46 files before the final synchronous-call cleanup. Final targeted reruns passed 1,713 Codex tests across 34 files, 84 core ownership tests, and 275 Gateway tests. The reply E2E run selected the changed fallback behavior; 165 unrelated cases were not selected. Regression failures were captured before the corresponding repairs, including wrong host-auth tuple preparation, stale credentials across resume, and a distinct finalizer/native selection with different configured prices.

Aggregate changed checks passed, the full normal build including Control UI passed, the SDK surface check passed, and full-candidate independent Codex autoreview returned zero accepted findings at the requested P0-only threshold. That review is scoped evidence, not a claim that all lower-priority findings were exhaustively ruled out.

The initial verification rebase onto 94edd0f0d5fc0f124c21a2a6f7b4e4f25c847489 preserved main's CLI settlement/classifier ownership, configured-MCP cleanup, auth-plan test-global removal and Gateway list projection. git range-diff shows the first ownership commit unchanged and only import context changed in the second; the sole conflict retained main's removal of obsolete CLI binding writers plus this patch's ModelRef type.

The exact integrated head a7c8086df55ec56a625f58768506788783caae9d then passed 1,113 tests across 16 files / six Vitest shards (950.85 seconds), changed-file formatting, the full normal build (497.40 seconds), and a fresh complete branch autoreview (two bounded passes, zero accepted P0 findings). The integration selection covers CLI settlement, host-auth preparation, accounting/memory, Gateway metadata/list projection and native lifecycle/turn execution. All three real two-turn live scenarios were then replayed successfully against that exact integrated build. The first CI run caught a type-only import cycle plus five stale assertions in two boundary test files. Follow-up f5d1809ca367 removes the facade dependency and preserves precise ownership assertions without coupling them to argument arity. The full architecture chain, normal build, 369-test persisted ownership/lifecycle matrix, changed checks and fresh independent review pass. Exact commands and all ClawSweeper compatibility/rank-up dispositions are recorded in the proof comment; new exact-head CI remains required before native landing.

Final merge-tree verification found a file-size interaction with main's metadata shutdown handling and an unrelated LINE startup fixture flake. The per-session decorator is now a narrow module, preserving cache/stop ownership while reducing the actual merged runtime from 728 to 695 logical lines. Exact merged-tree lint and 80 metadata/shutdown tests pass; the repaired LINE HTTP/readiness/cleanup fixture passes the full 838-test lane. Changed checks, another normal build and fresh independent review pass. Shared-main UI/build validation failures were handled by the already-open #136817 and #136878, both now merged; no UI or budget baseline is changed here. The latter fixes the 17-byte CSS overage and stale artifact-test expectations. The draft/ready-triggered CI run still checked out GitHub's old eabe16ba merge into 41419be4, so it repeated those fixed failures. A corrective rebase onto e284f6597f48ad6013d66530fc0560e5ce3793fc now includes both fixes in the branch ancestry. All five patches are identical in git range-diff; 356 tests across 13 files (556.63 seconds), the full normal build (1100.83 seconds), and fresh full-branch P0 review pass. Current head is 9ecdfc746b6d, with exact commands and compatibility dispositions in the linked proof comment. Exact-head CI 33715145287 passed: 141 successful jobs, 16 intentionally skipped, including the required openclaw/ci-gate. Its checkout was merge fa068ec0665a9c5f2d232f980781eed761ad20dc into main 7033d859419dcd7f5dbaf2a00ea29c23106ae8b8. Native prepare passed on the same head; its receipt is in the proof comment. The final merge receipt is recorded separately.

Dependency contract and solution scope

The acting lead personally inspected sibling Codex rust-v0.152.1 at 5adb68a49933ae446bf11935662c83dba55a0804: codex-rs/app-server/src/request_processors/thread_processor.rs:215–268 restores persisted selection only without an override; :4003–4019 and :5161–5175 report the actual configured resume/fork tuple. Native compaction, initialize-originator, and API-key credential-store contracts were also checked directly. Source wrappers or generated protocol types were not used as substitutes for that inspection.

The repair removes lock/hint ownership inference, duplicate pin policy, obsolete async-only binding-read chains, and two dead private configuration re-exports. The shared codec is a move, not a second reader. Producer repair was preferred over deleting usage observations, globally declaring auth ready, copying native model state into a new persisted mirror, or bypassing the composer warning.

Production LOC: +1,367/−786, net +581; tests/support: +3,672/−1,381, net +2,291; docs: +146/−32, net +114; one shrink-only ratchet line, net zero. Pure codec/test moves do not represent new behavior. Production growth pays for the shared private ownership/read boundary, exact host-auth tuple freshness, and separation of native session selection from response accounting. The synchronous caller cleanup itself is net-negative. No guard limits or assertions were weakened.

Nearby fixture repairs respond when initialize actually reaches the wire and join cleanup, choose a timezone distinct from the host, use real public SDK exports with narrow logger spies, type the read-only binding fixture instead of hiding an async mock behind casts, and wait for the context-overflow fresh-turn boundary rather than arbitrary polling. The original context-overflow timeout cause was not proven; its deterministic readiness repair retained all request/outcome assertions and the exact 34-file rerun passed. Native metadata tests were moved intact into their own suite using existing support. The assertion baseline only shrinks two removed undocumented casts.

Limits and related follow-ups

Live native proof is API-key-backed supervision, not OAuth account-identity proof. It checks exact credential bytes and connection scope, not independently identified billing-account identity. The concrete proof establishes authored Responses controls, not that a compaction checkpoint was reached. Finalizer/native-model separation is covered by composed accounting regressions, not the separate unpublished native-finalizer dependency patch.

The worker catalog readiness gap in #134460, supervision policy diagnostics in #135310, and provider-card native/direct auth presentation in #129766 are separate open follow-ups, not claimed fixed here. The concrete model-picker's “Codex-controlled model” wording also has a separate scoped follow-up. No release or package publication is part of this PR.

@clawsweeper

clawsweeper Bot commented Sep 2, 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 channel: voice-call Channel integration: voice-call gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: XL maintainer Maintainer-authored PR labels Sep 2, 2026
@steipete
steipete marked this pull request as ready for review September 2, 2026 23:58
@steipete
steipete requested a review from a team as a code owner September 2, 2026 23:58
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Real concrete-chat before/after proof

After: a7c8086df55. Before: b3fcdf31620.

The first screenshot is the untouched baseline: both normal-composer turns fail before provider inference at the false session-pinned harness assertion. The second screenshot and video show the repaired flow: FIRST_OK, followed by remembered ORBIT-CEDAR SECOND_OK.

Both repaired calls returned HTTP 200 through the real Responses API, and both actual outgoing request summaries retained context_management and store=true. Durable state preserved the concrete model, plugin owner, lock and requested Codex runtime. The producing runtime was recorded as OpenClaw without reclassifying the second turn. This proves authored request controls survived; it does not claim a compaction checkpoint was reached.

Source-built isolated Gateway and real Control UI/provider; no mock Gateway/provider or UI bypass. Every attached capture was inspected and contains only synthetic data. The proof instance was stopped and its isolated runtime removed. The misleading concrete “Codex-controlled model” picker label is a separate existing follow-up, not the ownership source.

03-turn-2

03-turn-2

attachment-672979570.webm

@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Real native-supervision before/after proof

After: a7c8086df55. Before: b3fcdf31620.

The first screenshot is the untouched baseline: the imported native source has already answered successfully, but the composer blocks continuation on unrelated missing host credentials. The second screenshot and video show both repaired normal-composer turns recalling NATIVE-ORBIT and completing successfully.

The native model was deliberately different from the outer configured model. After each turn, private binding, durable session and public sessions.list agreed on the native provider/model. Native credential bytes, original source transcript, source lineage and the canonical supervised thread were preserved; the host provider auth stores stayed empty. The listed native model row omitted only inapplicable host-auth availability fields, without declaring credentials ready.

A second fresh run omitted the native model from the host catalog entirely. It also completed both turns and did not fabricate a catalog row. This is API-key-backed native supervision, not OAuth account-identity proof or the separate tool-only native-finalizer work.

Source-built isolated Gateway, real Control UI and real pinned Codex/OpenAI inference; no direct state mutation or auth/UI bypass. Every attached capture was inspected and contains only synthetic data. All proof instances were stopped and their isolated runtimes removed.

03-turn-2

03-turn-2

attachment-3921213278.webm

@steipete

steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Ownership proof and exact local commands

Current head: 9ecdfc746b6d, based on e284f6597f48ad6013d66530fc0560e5ce3793fc. Prior fully reviewed head: cd7e5e4e937469c413551a12b2b0b8db8aacb9e7; all five rebased patches are identical.

Original integrated runtime/live-proof head: a7c8086df55ec56a625f58768506788783caae9d; base: 94edd0f0d5fc0f124c21a2a6f7b4e4f25c847489.

OPENCLAW_VITEST_MAX_WORKERS=4 node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/backend.test.ts src/agents/embedded-agent-runner/run/model-setup.ownership.test.ts src/agents/embedded-agent-runner/run/terminal-preparation.test.ts src/agents/embedded-agent-runner/run/settled-turn-finalization.test.ts src/agents/embedded-agent-runner/run.harness-auth-failover.test.ts src/agents/embedded-agent-runner/run/auth-plan.auth-pin.test.ts src/agents/command/attempt-execution.cli.test.ts src/auto-reply/reply/agent-runner-result-accounting.persistence.test.ts src/auto-reply/reply/agent-runner-memory.test.ts src/gateway/server-methods/chat-metadata-runtime.test.ts src/gateway/server-methods/chat-metadata-runtime.native-session.test.ts src/gateway/session-utils.test.ts extensions/codex/harness.session-runtime-ownership.test.ts extensions/codex/src/app-server/thread-lifecycle.test.ts extensions/codex/src/app-server/run-attempt.context-engine.test.ts extensions/codex/src/app-server/run-attempt.test.ts

Result: 1,113 passed, 16 files, six shards; wrapper exit 0 in 950.85 seconds. Per-shard counts: Gateway 274, accounting/memory 179, embedded-agent 16, embedded-agent-run 70, CLI/support 143, Codex 431. The Gateway count is one lower than the prior base because main removed an obsolete cache-internal test; all new native ownership coverage is retained.

pnpm build

Result: exit 0 in 497.40 seconds, including SDK/unified declarations, bundled plugins, Control UI and its performance checks. No ineffective-dynamic-import warning.

git diff --check

Result: pass. node_modules/.bin/oxfmt --check also passed for every changed TypeScript/Markdown file; the explicit file-list command is retained in the local validation summary.

git range-diff b3fcdf31620d5c829554f65566a494385823fed6..9544c8c80eb 94edd0f0d5fc0f124c21a2a6f7b4e4f25c847489..a7c8086df55ec56a625f58768506788783caae9d

Result: first commit unchanged; second commit differs only in import context, preserving main's deletion of obsolete CLI binding writers. Fresh full-branch independent Codex autoreview returned scoped-clean at P0 across two complete bounded passes; no reviewer isolation or secret scanning was bypassed.

CI repair and final compatibility coverage

CI repair head before the conflict rebase: f5d1809ca367.

The first CI run found a Madge type dependency cycle and five stale assertions in two test files. All failures reproduced locally. ModelRef now imports directly from its defining module instead of the routing facade. The tests still require the complete prepared input, one dispatch and no invented native ownership, without distinguishing omitted from explicit undefined; metadata coverage explicitly requires the canonical session key and keeps the neutral call unscoped. No executable runtime logic, guard, timeout or stored representation changed in this follow-up.

pnpm check:architecture

Pass, 226.90 seconds: zero runtime cycles, zero Madge cycles, and every subsequent architecture/database guard passed. Before the repair, the same Madge check reported one cycle.

pnpm build

Pass after the type-only fix, 367.69 seconds, with no ineffective-dynamic-import warning.

OPENCLAW_VITEST_MAX_WORKERS=4 node scripts/run-vitest.mjs src/gateway/server-methods/chat-history-handler.test.ts src/agents/embedded-agent-runner/run.overflow-compaction.loop.test.ts src/agents/embedded-agent-runner/run/model-setup.ownership.test.ts src/agents/embedded-agent-runner/run.harness-auth-failover.test.ts extensions/codex/harness.session-runtime-ownership.test.ts extensions/codex/src/app-server/session-binding.test.ts extensions/codex/src/app-server/thread-lifecycle.binding.test.ts extensions/codex/src/app-server/startup-binding.test.ts extensions/codex/src/app-server/upstream-session-fork-continuation.test.ts extensions/codex/src/app-server/run-attempt-connection.test.ts

Pass: 369 tests, 10 files, four shards, 457.02 seconds on the final source. This covers persisted locked-session ownership, host/native authentication, saved binding reads, lifecycle generations, pending supervision materialization, native resume preservation and both repaired assertion boundaries.

node scripts/check-changed.mjs -- src/agents/harness/types.ts src/gateway/server-methods/chat-history-handler.test.ts src/agents/embedded-agent-runner/run.overflow-compaction.loop.test.ts

Pass, along with formatting and a fresh independent P0 autoreview of all three follow-up files.

Conflict rebase verification

Main added finalization coverage in the same native transport test, making the first CI-fix head unmergeable. The rebase preserves that production change and table-drives both final-answer and tool-only cases, retaining native attribution, source/transcript/replay safeguards, native-auth finalization unavailability, and transport/home rejection. The first ownership commit and CI-fix commit are patch-identical; the middle commit changes only this test composition relative to the previously reviewed delta.

OPENCLAW_VITEST_MAX_WORKERS=4 node scripts/run-vitest.mjs extensions/codex/src/app-server/run-attempt.test.ts src/agents/embedded-agent-runner/run/settled-turn-finalization.test.ts src/agents/embedded-agent-runner/run/model-setup.ownership.test.ts src/agents/embedded-agent-runner/run.overflow-compaction.loop.test.ts src/gateway/server-methods/chat-history-handler.test.ts

Pass on current head: 240 tests, five files, four shards, 194.54 seconds, including both final-answer and tool-only native paths and both repaired assertion files.

node scripts/check-changed.mjs -- extensions/codex/src/app-server/run-attempt.test.ts extensions/codex/src/app-server/run-attempt-finalize.ts src/agents/embedded-agent-runner/run/settled-turn-finalization.test.ts

Pass, 638.11 seconds. A normal pnpm build also passed on current head (1037.85 seconds), without ineffective-dynamic-import warnings. A fresh full-branch Codex autoreview against the new base returned scoped-clean at P0 across two complete bounded passes. The runtime ownership implementation is unchanged by the conflict resolution; the earlier real live evidence remains linked above.

ClawSweeper acceptance and rank-up disposition

Addressing the review's compatibility requests and rank-up move:

  • Existing locked-session coverage: completed by the 369-test matrix above, alongside the source-matching real concrete/listed-native/unlisted-native two-turn proof. Post-live production edits are an erased type import and the equivalent per-session metadata extraction documented below; no ownership/auth behavior was changed by those follow-ups.
  • Config/default compatibility: no public config keys, defaults or authored request parameters were added or removed. Concrete model locks remain locks; runtime requests and observed producers no longer impersonate native ownership. Authored Responses controls and host-profile selection semantics remain covered.
  • Stored-data compatibility: the review's unknown-truncated-pull-files flag is a scope uncertainty, not an identified schema change. Full local inspection covers all 143 changed files. The existing binding codec, key and generation rules retain the same stored representation; no table, schema version, migration, sidecar or persisted ownership mirror is added. Correct native selection uses the existing session model fields. Existing binding/lifecycle fixtures and real saved-native-source continuation pass.
  • Owner/contract disposition: accept the optional, guarded ownership callback under the explicit maintainer instruction to improve and land this repair. The authenticated author is an active maintainer of the listed openclaw-secops team; live rules and review state showed no mandatory independent-approval requirement. Harnesses without the optional callback retain concrete preparation; implemented native ownership must remain current or fail closed. This is a read-only fact seam, not transferred execution authority. The alternative Codex-specific core route would violate the plugin-agnostic owner boundary. The judged production growth is accepted for this shared read boundary, exact host-auth tuple fences, and independent session-versus-response accounting; moves and test growth are not new capability.
  • CI and final enforcement: exact-head CI on 9ecdfc746b6d92bd69d81c1495549b1f6dc8226d is green. The latest completed ClawSweeper review and fresh full-branch independent review both cover this head with no actionable correctness/security finding. Native prepare/merge rechecks live enforcement. Both rank-up moves—CI and owner contract acceptance—are addressed, with config/data/LOC rationale above; no redundant bot re-review is requested.

Final merged-CI follow-up

The next CI run tested merge 5377164aaf5bfb7298ba5f5d80c99632d082942e with main's new metadata shutdown handling. That combination exceeded the file-size guard. The unchanged synchronous session-only decorator is now a narrow projection module, leaving all shared cache/stop/active-work behavior in its original owner. The exact failed merge plus this extraction passes lint at 695 logical lines instead of 728, and all 80 metadata, shutdown and Gateway lifecycle tests pass.

node scripts/run-oxlint.mjs --tsconfig tsconfig.json src/gateway/server-methods/chat-metadata-runtime.ts src/gateway/server-methods/chat-metadata-session-projection.ts
node scripts/run-vitest.mjs src/gateway/server-methods/chat-metadata-runtime src/gateway/server-methods/chat-history-handler.test.ts src/gateway/server-chat-metadata-lifecycle

Those two commands ran in the exact CI merge snapshot with only the reviewed fix overlaid; source and lifetime ordering were inspected. No line-limit suppression or limit change was made.

CI also exposed a LINE startup test that left its real optional HTTP probe unmocked while polling monitor entry for one second. The fixture now uses the existing local HTTP responses, observes provider entry or early task settlement, and always aborts/joins. Credential/account/status assertions remain, abort-signal forwarding is checked, and two casts were removed through the actual monitor parameter type. The precise delayed-versus-early-error state of the original CI run remains unknown; no timeout or retry was added.

node scripts/run-vitest.mjs extensions/line

Pass: 838 tests, 54 files, 73.18 seconds.

node scripts/check-changed.mjs -- src/gateway/server-methods/chat-metadata-runtime.ts extensions/line/src/setup-surface.test.ts src/gateway/server-methods/chat-metadata-session-projection.ts

Pass, 921.86 seconds. The normal build passed again (577.07 seconds), with no ineffective-dynamic-import warning. Fresh independent review of the complete follow-up plus the merged metadata file returned scoped-clean at P0.

The third failure was shared main's UI budget, reproduced in an isolated exact-tree build at 349385 B against a 349244 B limit (CI measured 349396 B). None of this PR's changed modules appeared in boot source maps. The already-open UI budget PR #136817 has merged as bf5753075a54; this PR makes no UI or budget-baseline changes. The next source push incorporated that upstream fix into CI's merge snapshot.

The following CI run passed the JS budget but exposed two further shared-main failures: startup CSS exceeded the existing cap by 17 bytes, and two artifact tests still expected config_newer after intentional clean-Git precedence returned clean. Both were already covered by PR #136878 — restore current-main build validation, now merged as 507e5faf2850. This PR changes neither UI budget nor artifact policy. The protected CLI's supported draft/ready transition created fresh CI 33710980531 on unchanged head cd7e5e4e937469c413551a12b2b0b8db8aacb9e7; the PR is open, ready and mergeable. That run finished with 138 successful jobs but repeated the same fixed CSS/artifact failures: its checkout log proves it still used merge eabe16ba940ce9fbc4b88b7cf09768ecb531c6e8 into main 41419be40bbb17e5eed318992c8e3bf1aee6199b. A new run event did not refresh the merge snapshot.

Corrective rebase with fixes in branch ancestry

The branch is now rebased onto e284f6597f48ad6013d66530fc0560e5ce3793fc, including both upstream fixes. Every one of the five commits is patch-identical:

git range-diff 14f502a277bd4c27b0360f3727f2973b0d0362f2..cd7e5e4e937469c413551a12b2b0b8db8aacb9e7 e284f6597f48ad6013d66530fc0560e5ce3793fc..9ecdfc746b6d92bd69d81c1495549b1f6dc8226d
OPENCLAW_VITEST_MAX_WORKERS=4 node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/model-setup.ownership.test.ts src/agents/embedded-agent-runner/run/backend.test.ts src/agents/embedded-agent-runner/run/settled-turn-finalization.test.ts extensions/codex/src/app-server/run-attempt.test.ts extensions/codex/src/app-server/run-attempt-connection.test.ts src/gateway/server-methods/chat-metadata-runtime src/gateway/server-methods/chat-history-handler.test.ts src/gateway/server-chat-metadata-lifecycle test/scripts/repo-e2e-artifacts.test.ts packages/llm-core/src/utils/event-stream.test.ts

Pass: 356 tests, 13 files, five shards, 556.63 seconds. This includes the previously failing artifact boundary, native startup/ownership/finalization, metadata shutdown and incoming event-stream retention.

pnpm build

Pass: 1100.83 seconds, including all SDK/bundled/runtime outputs, Control UI and both performance budgets. No ineffective-dynamic-import warning. Fresh full-branch independent Codex autoreview returns scoped-clean at P0 across two complete passes, with no findings. Read-only integration inspection confirms worker GitHub bindings remain exec-environment facts, cloud workers still exclude native harness execution, and event-stream queue release does not erase its separately owned terminal result or Codex's ready-thread selection. Production/test/docs LOC are unchanged. No extra feature or fallback was introduced to obtain green proof. Exact-head CI 33715145287 passed on the new head: 141 successful jobs, 16 intentionally skipped; required openclaw/ci-gate job 100525389030 succeeded. The actual checkout log confirms merge fa068ec0665a9c5f2d232f980781eed761ad20dc into main 7033d859419dcd7f5dbaf2a00ea29c23106ae8b8, with the upstream fixes included. The latest completed ClawSweeper review covers exact 9ecdfc and finds no actionable defect; its CI rank-up is now satisfied, and owner/config/data/LOC dispositions remain above. Native landing still revalidates live enforcement.

Native prepare receipt

OPENCLAW_TESTBOX=1 scripts/pr prepare-run 136754

Passed. Hosted CI/Testbox gates were accepted through hosted_exact_or_recent_parent; the prepared and remote head both remain 9ecdfc746b6d92bd69d81c1495549b1f6dc8226d. No new push, rebase, changelog change, approval bypass or replacement proof was needed. Native scripts/pr merge-run 136754 then verified the same exact head and landed 289f1406a4b128dfa2b45234002bc990586e9f39 on main. The wrapper's completion receipt confirms the merge; the native PR worktree was cleaned up. The linked native-model continuation issue closed automatically. Mainline-drift warnings were advisory, not bypassed gates; the relevant overlapping finalizer changes were inspected and the native merge-tree receipt validated the actual landed content. The final checkout was fast-forwarded to current main in detached mode because another worktree owns the local main branch. No release or package publication occurred.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 12:40 AM ET / 04:40 UTC.

ClawSweeper review

What this changes

The PR preserves a pinned Codex session’s native or host-owned model selection across chat turns and projects the resulting model into session metadata and accounting.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 7 items remain

Keep open: source review supports the repair, but the new generic AgentHarness ownership contract needs area-owner acceptance and exact-head CI completion.

Priority: P1
Reviewed head: 9ecdfc746b6d92bd69d81c1495549b1f6dc8226d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Reported real-flow proof and coherent owner-boundary checks support the repair, while the generic contract awaits owner acceptance and exact-head CI.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR discussion records an isolated two-turn Control UI and Codex App Server before/after scenario, while source inspection connects it to the binding-backed ownership read and turn-time rechecks; linked artifacts were not downloaded in this read-only review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR discussion records an isolated two-turn Control UI and Codex App Server before/after scenario, while source inspection connects it to the binding-backed ownership read and turn-time rechecks; linked artifacts were not downloaded in this read-only review.
Evidence reviewed 6 items Ownership boundary: The new helper reads the pinned harness’s synchronous ownership callback and rejects changed harness or session state before returning the ownership fact.
Model preparation: The embedded runner now derives a native session’s model and authentication mode from the pinned binding rather than the former lock-and-harness heuristic, and rejects stream overrides for native-auth sessions.
Codex implementation and revalidation: The Codex harness reads its binding store for ownership and the App Server path rechecks expected ownership before lifecycle acquisition and turn start.
Findings None None.
Security None None.

How this fits together

OpenClaw’s embedded agent runner selects a model and harness for each session turn. For a pinned Codex App Server thread, this change reads the authoritative binding first and rechecks that ownership before continuing the native thread.

flowchart LR
  A[Incoming chat turn] --> B[Session admission]
  B --> C[Read pinned runtime ownership]
  C --> D[Prepare model and harness]
  D --> E[Codex thread resume]
  E --> F[Start native turn]
  F --> G[Session metadata and accounting]
Loading

Decision needed

Question Recommendation
Should OpenClaw expose resolveSessionRuntimeOwnership as the accepted generic AgentHarness contract for preserving a native session’s model and authentication ownership? Accept the ownership seam: Approve the documented synchronous binding-backed callback as the canonical ownership mechanism, then require exact-head CI.

Why: This deliberately expands a compatibility-sensitive plugin contract across session selection and authentication; source review cannot substitute for owner intent.

Before merge

  • Resolve merge risk (P1) - This bug-fix branch adds a generic AgentHarness ownership callback with net production growth; maintainers should explicitly accept that compatibility-sensitive API boundary.
  • Resolve merge risk (P1) - Exact-head CI was not complete in the supplied context, leaving final cross-cutting validation outstanding.
  • Complete next step (P2) - Complete exact-head CI and obtain explicit agent-harness area-owner acceptance of the documented session-ownership callback contract.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test delta production +1,368/-787; tests and test support +3,672/-1,381; docs +146/-32 The bug fix substantially grows production code and adds a plugin API, so owner confirmation of the canonical boundary matters before merge.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Approve and validate the ownership seam (recommended)
    Have the agent-harness area owner accept the documented callback semantics and let exact-head CI complete before merge.
  2. Return for a narrower boundary
    Pause this implementation if maintainers prefer not to add a generic plugin callback for a Codex-specific ownership concern.

Technical review

Best possible solution:

Accept the documented callback only if the agent-harness owner confirms it is the canonical cross-plugin ownership seam, then complete exact-head CI.

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

No independent high-confidence current-main reproduction was established in this read-only review; source inspection and the reported before/after flow make the path source-reproducible.

Is this the best way to solve the issue?

Yes in source review: the binding is the authoritative owner of the model/auth tuple, and the patch revalidates it before lifecycle and turn side effects; the generic seam still needs owner acceptance.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 84966331a760.

Labels

Label changes:

  • remove proof: 🎥 video: Current real behavior proof evidence kind is linked_artifact.

Label justifications:

  • P1: The PR addresses model and authentication ownership drift that can block real Codex chat continuations.
  • merge-risk: 🚨 compatibility: It adds a documented AgentHarness callback that changes how pinned sessions select their model and authentication source.
  • merge-risk: 🚨 auth-provider: The callback determines whether Codex uses host credentials for a stored native model tuple or native authentication.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR discussion records an isolated two-turn Control UI and Codex App Server before/after scenario, while source inspection connects it to the binding-backed ownership read and turn-time rechecks; linked artifacts were not downloaded in this read-only review.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR discussion records an isolated two-turn Control UI and Codex App Server before/after scenario, while source inspection connects it to the binding-backed ownership read and turn-time rechecks; linked artifacts were not downloaded in this read-only review.

Evidence

Acceptance criteria:

  • [P1] Complete the PR’s exact-head CI matrix.

What I checked:

  • Ownership boundary: The new helper reads the pinned harness’s synchronous ownership callback and rejects changed harness or session state before returning the ownership fact. (src/agents/harness/session-runtime-ownership.ts:9, 9ecdfc746b6d)
  • Model preparation: The embedded runner now derives a native session’s model and authentication mode from the pinned binding rather than the former lock-and-harness heuristic, and rejects stream overrides for native-auth sessions. (src/agents/embedded-agent-runner/run/model-setup.ts:145, 9ecdfc746b6d)
  • Codex implementation and revalidation: The Codex harness reads its binding store for ownership and the App Server path rechecks expected ownership before lifecycle acquisition and turn start. (extensions/codex/harness.ts:119, 9ecdfc746b6d)
  • Documented SDK contract: The PR documents that ownership is read only for a validated pinned harness, synchronously and without discovery or mutation; a missing owner visibly fails instead of creating a replacement thread. Public docs: docs/plugins/sdk-agent-harness.md. (docs/plugins/sdk-agent-harness.md:95, 9ecdfc746b6d)
  • Codex App Server contract: The inspected App Server documentation requires initialize, thread start/resume, then turn start; it also states that explicit model or modelProvider resume values disable the persisted-model fallback. The protocol accepts and returns both fields. (codex-rs/app-server/README.md:78, 5adb68a49933ae446bf11935662c83dba55a0804)
  • History and main status: The ownership implementation was introduced by this commit and is not an ancestor of the fetched main revision; no containing release tag was locally available. Further main-blob inspection was blocked by the partial clone’s unreachable promisor remote. (src/agents/harness/session-runtime-ownership.ts:9, 761df4e6f7d7)

Likely related people:

  • unknown: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Obtain explicit agent-harness area-owner acceptance of the documented callback contract.
  • Complete exact-head CI.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-03T00:07:54.476Z sha a7c8086 :: blocked before merge. :: none
  • reviewed 2026-09-03T01:01:10.033Z sha f5d1809ca3672c20f589387fcc21f3dbf45db900 :: blocked before merge. :: none
  • reviewed 2026-09-03T01:42:54.222Z sha 78e1cdb :: blocked before merge. :: none
  • reviewed 2026-09-03T02:39:34.856Z sha cd7e5e4 :: blocked before merge. :: none
  • reviewed 2026-09-03T03:30:57.554Z sha cd7e5e4 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Sep 3, 2026
steipete added a commit that referenced this pull request Sep 3, 2026
Import ModelRef from its defining contract rather than the model-selection
facade, removing the Madge dependency cycle without changing runtime code.

Keep metadata assertions explicit about canonical session scope. Assert one
prepared dispatch and absent native ownership without coupling the tests to
omitted versus explicit undefined argument arity.

Follow-up for #136754. Reproduced the architecture failure and all five test
assertion failures from CI run 33697493195 before editing. Full architecture,
normal build, changed checks, 369 ownership/binding/lifecycle tests and fresh
Codex P0 autoreview pass. No guard, assertion invariant, timeout, config or
stored-data representation was weakened or changed.
@steipete
steipete force-pushed the steipete/elastic-grothendieck-ef4aef branch from f5d1809 to 78e1cdb Compare September 3, 2026 01:34
@clawsweeper clawsweeper Bot removed the proof: 🎥 video Contributor real behavior proof includes video or recording evidence. label Sep 3, 2026
steipete added a commit that referenced this pull request Sep 3, 2026
Keep the uncached synchronous session ownership overlay separate from the
shared metadata cache and lifecycle owner. Preserve projection/config/read
ordering, missing-row behavior and native/host auth distinctions.

The exact CI merge with main's stop/activeWork handling exceeded max-lines.
This extraction reduces it from 728 to 695 logical lines without suppressing
the guard or changing lifecycle behavior. No stored representation or public
config changes. Net production growth is four module/type boundary lines.

Proof: exact merged-file lint; 80 metadata/shutdown/lifecycle tests; changed
checks; normal build; fresh Codex P0 autoreview. Follow-up for #136754.
steipete added a commit that referenced this pull request Sep 3, 2026
Use the existing HTTP fixture for startup's real optional bot probe. Observe
actual provider entry or early task settlement instead of polling for one
second, retain account/credential/status assertions, and always abort/join.
Type monitor parameters from their owner and assert abort-signal forwarding.

CI exposed an unmocked probe before monitor startup; the exact remote pending
versus early-error outcome remains unknown. No timeout, retry, broad mock or
production seam is added. The full LINE lane passes 838 tests, and changed
checks plus independent review pass. Bounded CI cleanup for #136754.
@openclaw-barnacle openclaw-barnacle Bot added the channel: line Channel integration: line label Sep 3, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 3, 2026
@clawsweeper clawsweeper Bot added the proof: 🎥 video Contributor real behavior proof includes video or recording evidence. label Sep 3, 2026
Keep concrete locked model chats on model discovery and host auth instead of
promoting requested or observed runtimes into native ownership. Preserve real
Responses compaction parameters through declared transport fallback, including
subsequent turns after usage persistence records the producing harness.

Resolve native model and connection ownership from the existing private binding,
revalidate it across preparation and dispatch, and preserve expected native state
before recovery can replace it. Keep supervision auth separate from native model
preservation and ordinary host-auth failover. Align command, reply, memory,
compaction, voice, and plugin execution callers without new SDK exports or stores.
…ounting

Read private session ownership through one synchronous generation-checked
binding boundary. Keep native model and native auth ownership distinct,
prepare host credentials for the actual native tuple, and reject stale
ownership before dispatch, connection, lease use, and resumed turn start.

Project the actual ready native model into session metadata without requiring
unrelated host credentials or inventing catalog availability. Keep session
selection separate from finalizer response and billing attribution. Preserve
authored Responses controls for concrete model chats and observed producer
metadata across subsequent turns.

Migrate binding reads to the canonical synchronous API and repair nearby
fixture ownership/timing assumptions without relaxing assertions or timeouts.
No config option, dependency, schema, persisted mirror, or protocol change.

Related: #118642 (native catalog sessions resolving the outer default model).
Reporter: @RothElektronik.

Proof: composed owner regressions; final Codex matrix 1713 tests; core and
Gateway matrices 84 and 275 tests; aggregate changed checks; normal build;
SDK surface; full candidate P0 autoreview. Real isolated two-turn concrete,
listed-native, and unlisted-native dashboard flows pass. Responses controls,
native credentials, source history, thread identity, and public model checked.
Import ModelRef from its defining contract rather than the model-selection
facade, removing the Madge dependency cycle without changing runtime code.

Keep metadata assertions explicit about canonical session scope. Assert one
prepared dispatch and absent native ownership without coupling the tests to
omitted versus explicit undefined argument arity.

Follow-up for #136754. Reproduced the architecture failure and all five test
assertion failures from CI run 33697493195 before editing. Full architecture,
normal build, changed checks, 369 ownership/binding/lifecycle tests and fresh
Codex P0 autoreview pass. No guard, assertion invariant, timeout, config or
stored-data representation was weakened or changed.
Keep the uncached synchronous session ownership overlay separate from the
shared metadata cache and lifecycle owner. Preserve projection/config/read
ordering, missing-row behavior and native/host auth distinctions.

The exact CI merge with main's stop/activeWork handling exceeded max-lines.
This extraction reduces it from 728 to 695 logical lines without suppressing
the guard or changing lifecycle behavior. No stored representation or public
config changes. Net production growth is four module/type boundary lines.

Proof: exact merged-file lint; 80 metadata/shutdown/lifecycle tests; changed
checks; normal build; fresh Codex P0 autoreview. Follow-up for #136754.
Use the existing HTTP fixture for startup's real optional bot probe. Observe
actual provider entry or early task settlement instead of polling for one
second, retain account/credential/status assertions, and always abort/join.
Type monitor parameters from their owner and assert abort-signal forwarding.

CI exposed an unmocked probe before monitor startup; the exact remote pending
versus early-error outcome remains unknown. No timeout, retry, broad mock or
production seam is added. The full LINE lane passes 838 tests, and changed
checks plus independent review pass. Bounded CI cleanup for #136754.
@steipete
steipete force-pushed the steipete/elastic-grothendieck-ef4aef branch from cd7e5e4 to 9ecdfc7 Compare September 3, 2026 04:28
@clawsweeper clawsweeper Bot removed the proof: 🎥 video Contributor real behavior proof includes video or recording evidence. label Sep 3, 2026
@steipete
steipete merged commit 289f140 into main Sep 3, 2026
219 of 221 checks passed
@steipete
steipete deleted the steipete/elastic-grothendieck-ef4aef branch September 3, 2026 04:51
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…aw#136754)

* fix(agents): separate native ownership from runtime selection

Keep concrete locked model chats on model discovery and host auth instead of
promoting requested or observed runtimes into native ownership. Preserve real
Responses compaction parameters through declared transport fallback, including
subsequent turns after usage persistence records the producing harness.

Resolve native model and connection ownership from the existing private binding,
revalidate it across preparation and dispatch, and preserve expected native state
before recovery can replace it. Keep supervision auth separate from native model
preservation and ordinary host-auth failover. Align command, reply, memory,
compaction, voice, and plugin execution callers without new SDK exports or stores.

* fix(agents): preserve native model ownership through metadata and accounting

Read private session ownership through one synchronous generation-checked
binding boundary. Keep native model and native auth ownership distinct,
prepare host credentials for the actual native tuple, and reject stale
ownership before dispatch, connection, lease use, and resumed turn start.

Project the actual ready native model into session metadata without requiring
unrelated host credentials or inventing catalog availability. Keep session
selection separate from finalizer response and billing attribution. Preserve
authored Responses controls for concrete model chats and observed producer
metadata across subsequent turns.

Migrate binding reads to the canonical synchronous API and repair nearby
fixture ownership/timing assumptions without relaxing assertions or timeouts.
No config option, dependency, schema, persisted mirror, or protocol change.

Related: openclaw#118642 (native catalog sessions resolving the outer default model).
Reporter: @RothElektronik.

Proof: composed owner regressions; final Codex matrix 1713 tests; core and
Gateway matrices 84 and 275 tests; aggregate changed checks; normal build;
SDK surface; full candidate P0 autoreview. Real isolated two-turn concrete,
listed-native, and unlisted-native dashboard flows pass. Responses controls,
native credentials, source history, thread identity, and public model checked.

* fix(agents): keep ownership types off the routing facade

Import ModelRef from its defining contract rather than the model-selection
facade, removing the Madge dependency cycle without changing runtime code.

Keep metadata assertions explicit about canonical session scope. Assert one
prepared dispatch and absent native ownership without coupling the tests to
omitted versus explicit undefined argument arity.

Follow-up for openclaw#136754. Reproduced the architecture failure and all five test
assertion failures from CI run 33697493195 before editing. Full architecture,
normal build, changed checks, 369 ownership/binding/lifecycle tests and fresh
Codex P0 autoreview pass. No guard, assertion invariant, timeout, config or
stored-data representation was weakened or changed.

* refactor(gateway): isolate session-specific model metadata

Keep the uncached synchronous session ownership overlay separate from the
shared metadata cache and lifecycle owner. Preserve projection/config/read
ordering, missing-row behavior and native/host auth distinctions.

The exact CI merge with main's stop/activeWork handling exceeded max-lines.
This extraction reduces it from 728 to 695 logical lines without suppressing
the guard or changing lifecycle behavior. No stored representation or public
config changes. Net production growth is four module/type boundary lines.

Proof: exact merged-file lint; 80 metadata/shutdown/lifecycle tests; changed
checks; normal build; fresh Codex P0 autoreview. Follow-up for openclaw#136754.

* test(line): isolate account startup probe and cleanup

Use the existing HTTP fixture for startup's real optional bot probe. Observe
actual provider entry or early task settlement instead of polling for one
second, retain account/credential/status assertions, and always abort/join.
Type monitor parameters from their owner and assert abort-signal forwarding.

CI exposed an unmocked probe before monitor startup; the exact remote pending
versus early-error outcome remains unknown. No timeout, retry, broad mock or
production seam is added. The full LINE lane passes 838 tests, and changed
checks plus independent review pass. Bounded CI cleanup for openclaw#136754.
steipete added a commit that referenced this pull request Sep 3, 2026
Keep the selected catalog label or qualified model reference visible in
locked Control UI chats. Use Session model only when the selection is
unknown, and preserve the existing lock and model mutation guards.

Remove runtime-based ownership labeling and document that model editability
does not establish native ownership. Cover canonical Gateway rows, missing
catalog metadata, and runtime-independent labels with regression tests.

Fixes #137039. UI follow-up to #136754; runtime behavior is unchanged.
steipete added a commit that referenced this pull request Sep 3, 2026
* fix(ui): show concrete model names in locked chats

Keep the selected catalog label or qualified model reference visible in
locked Control UI chats. Use Session model only when the selection is
unknown, and preserve the existing lock and model mutation guards.

Remove runtime-based ownership labeling and document that model editability
does not establish native ownership. Cover canonical Gateway rows, missing
catalog metadata, and runtime-independent labels with regression tests.

Fixes #137039. UI follow-up to #136754; runtime behavior is unchanged.

* test(cron): synchronize timeout probe with child readiness

Freeze deadline timers until the real shell publishes a live descendant,
then advance the unchanged 0.5-second timeout and termination grace. This
keeps startup latency from consuming the process-group cleanup proof.

Reuse canonical PID and temporary-directory helpers and clean up processes,
timers, and the spawn spy even when setup fails. Cron runtime is unchanged.

Proof: all 10 command-runner tests, 10 sequential timeout-probe runs,
inherited-pipe descendant coverage, and deliberate setup-failure cleanup.
CI follow-through for #137041.

* fix(android): preserve new-turn scroll while history settles

Only include history loading in the reader effect key for empty timelines,
where it changes the transition. Populated-history completion must not
cancel a scroll after the owner records its new content version.

Reproduce loading completion during an observably moving animation and
require arrival at the newest turn. Preserve manual takeover and replacement
animation behavior without changing the full-message fixture.

Fixes #137111. Found during CI follow-through for #137041.
Proof: old owner stops at item 32/offset 141; repaired owner reaches 0/0.
All 57 reader/full-message tests, Kotlin lint, nine-file changed checks,
and :app:assemblePlayDebug pass. Native visual proof remains pending.

* test(update): expect system actor for gateway dispatch

Match the canonical in-process Gateway actor in the existing update tool
and /update exact-call assertions. Main now propagates the system actor;
these two expectations were missed while the shared helper tests changed.

Four failures reproduced on the CI merge baseline. All 50 owner and
sibling tests pass after the two-line expectation repair. Runtime behavior,
scopes, routing checks, mocks, and timeouts are unchanged.

Refs #137041.

* test(android): await rendered Settings reply completion

Wait for the actual enabled composer after the atomic reply state is published. Preserve publication-only waits for frozen-clock geometry tests and keep the existing timeout and reading assertions.

CI follow-through for #137041; controlled notification ordering reproduces the original stale working-row assertion.

* fix(android): publish WebSocket before handshake sends

Serialize socket publication with the existing transport write lock so an early OkHttp callback cannot send through an unpublished handle. Revalidate closure after waiting for that lock so a retired handshake cannot enqueue.

A real-socket regression holds the asynchronous factory return, reproduces the pre-fix gateway send failure, and covers disconnect during publication. No auth policy, wire payload, retry, or timeout changes. Fixes #137404; CI follow-through for #137041.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
* fix(ui): show concrete model names in locked chats

Keep the selected catalog label or qualified model reference visible in
locked Control UI chats. Use Session model only when the selection is
unknown, and preserve the existing lock and model mutation guards.

Remove runtime-based ownership labeling and document that model editability
does not establish native ownership. Cover canonical Gateway rows, missing
catalog metadata, and runtime-independent labels with regression tests.

Fixes openclaw#137039. UI follow-up to openclaw#136754; runtime behavior is unchanged.

* test(cron): synchronize timeout probe with child readiness

Freeze deadline timers until the real shell publishes a live descendant,
then advance the unchanged 0.5-second timeout and termination grace. This
keeps startup latency from consuming the process-group cleanup proof.

Reuse canonical PID and temporary-directory helpers and clean up processes,
timers, and the spawn spy even when setup fails. Cron runtime is unchanged.

Proof: all 10 command-runner tests, 10 sequential timeout-probe runs,
inherited-pipe descendant coverage, and deliberate setup-failure cleanup.
CI follow-through for openclaw#137041.

* fix(android): preserve new-turn scroll while history settles

Only include history loading in the reader effect key for empty timelines,
where it changes the transition. Populated-history completion must not
cancel a scroll after the owner records its new content version.

Reproduce loading completion during an observably moving animation and
require arrival at the newest turn. Preserve manual takeover and replacement
animation behavior without changing the full-message fixture.

Fixes openclaw#137111. Found during CI follow-through for openclaw#137041.
Proof: old owner stops at item 32/offset 141; repaired owner reaches 0/0.
All 57 reader/full-message tests, Kotlin lint, nine-file changed checks,
and :app:assemblePlayDebug pass. Native visual proof remains pending.

* test(update): expect system actor for gateway dispatch

Match the canonical in-process Gateway actor in the existing update tool
and /update exact-call assertions. Main now propagates the system actor;
these two expectations were missed while the shared helper tests changed.

Four failures reproduced on the CI merge baseline. All 50 owner and
sibling tests pass after the two-line expectation repair. Runtime behavior,
scopes, routing checks, mocks, and timeouts are unchanged.

Refs openclaw#137041.

* test(android): await rendered Settings reply completion

Wait for the actual enabled composer after the atomic reply state is published. Preserve publication-only waits for frozen-clock geometry tests and keep the existing timeout and reading assertions.

CI follow-through for openclaw#137041; controlled notification ordering reproduces the original stale working-row assertion.

* fix(android): publish WebSocket before handshake sends

Serialize socket publication with the existing transport write lock so an early OkHttp callback cannot send through an unpublished handle. Revalidate closure after waiting for that lock so a retired handshake cannot enqueue.

A real-socket regression holds the asynchronous factory return, reproduces the pre-fix gateway send failure, and covers disconnect during publication. No auth policy, wire payload, retry, or timeout changes. Fixes openclaw#137404; CI follow-through for openclaw#137041.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: line Channel integration: line channel: voice-call Channel integration: voice-call docs Improvements or additions to documentation extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

Codex catalog: modelSelectionLocked session resolves default agent model instead of native snapshot model

1 participant