Skip to content

fix(models): align picker allow lists and Doctor guidance - #144780

Closed
obviyus wants to merge 20 commits into
mainfrom
feat/allow-list-one-view
Closed

obviyus wants to merge 20 commits into
mainfrom
feat/allow-list-one-view

Conversation

@obviyus

@obviyus obviyus commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and behavior

A configured fallback could appear in a picker even when the allow list rejected it. An absent authored primary could be labeled Default and sent to the provider. A recovery explanation delivered in Telegram could be absent from shared web history while its receipt suppressed another explanation. Manual compaction could also apply the missing primary's credential profile to a replacement from another provider and fail before making a request.

This change publishes one permitted catalog and effective default, stores a delivered recovery explanation in its existing assistant row, and requires a separate interactive choice before Doctor broadens an old generated allow list.

Ayaan reviews. Landing remains gated on the independent census verdict ACCEPT and the orchestrator grant.

  • An authored primary has a selection-policy exception; a confirmed-missing default uses an allowed effective default. Stored blocked pins remain saved; replies use the allowed effective default. Missing or failed discovery does not prove a valid model disappeared.
  • Exact and wildcard lists govern picker/manual selection; automatic fallback retention does not grant selection permission. No authored primary means a caller’s stored model gets no primary exception.
  • Web, native, and channel clients consume shared hidden-count, blocked-selection, default-tag, and settings-path facts. Chat all covers allowed pages; explicit CLI/RPC inventory remains separate.
  • A receipt requires successful notice delivery, exact assistant-row reconciliation, publication, and current authority. A failed notice can appear on a fresh retry; a later distinct diagnostic failure does not undo a completed notice receipt.
  • Native-owned compaction remains with its runtime. Command catalog lookup retains admitted identity while command-resolved config retains secret and execution policy. Host-finalized replies have an explicit private publication marker, so writer authority cannot cause a duplicate streamed final.

No new database table, migration, schema version, authored config option, dependency, endpoint correction, or wire version is introduced.

Validation checkpoint

Candidate 1989d38e6fe0ed19231710f734fe19fd771c173b keeps this as one PR. Its production code is byte-identical to built and tested parent 998ff128b8c3d046a8757c2d4ea1b68d62b85afc; the final commit corrects two test assertions. The head is frozen for the independent census verdict.

The latest correction fixes three production-entry failures:

  • On a635eacb, a real chat.send model-list command omitted the usable replacement's Default label. Channel projection now carries the effective default to labels, reset, selection, and native command choices while retaining the authored diagnostic.
  • The registered agentExecCommand construction regression failed on the prior integration and passed on b25510f1. The effective-default resolver replaced a valid registered process backend before admission. Canonical CLI-provider recognition now preserves that backend's model authority; the original regression passes without changing its assertions.
  • A real Doctor process warned that five available provider models were absent because its temporary passive inventory was empty. It now uses the existing scoped read-only discovery operation and defers inspection when discovery is incomplete. Preview still cannot accept the separate wildcard-expansion offer.

Scoped formatter and lint checks passed. Targeted Telegram, Discord picker/options/autocomplete, Mattermost, and registered CLI-backend checks passed. The first new autocomplete fixture omitted the runtime-config publication used by registered handlers; the corrected setup preserves the exact expected choice and passes alone and in its file's original order. An independent read-only review found no actionable issue in the 19-file correction. The real Gateway/CLI missing-primary and reset matrix passes all three cases; the compaction/auth matrix passes both cases. Doctor passes six of seven cases. The retained deprecated-only negative fails for the independently proved base-owned reason below; Ayaan explicitly directed that it not block publication.

Retained live proof on a635eacb demonstrates authored-typo and withdrawn-model recovery through Telegram and web-facing chat.send, with recorded fake-provider requests using the effective default. First Telegram recovery notices appear in shared web history, survive reconnect/restart, and are not repeated by later web or Telegram replies for the same pin. The earlier original-defect base proof and failed attempts remain retained; these later controls do not replace them.

The built integration 0e676708b602439b65430a7b0c66472f547f7ed4 also includes the separate login-lifecycle repair. Real Telegram login on the accepted API endpoint publishes a previously unknown row, permits selection and a fake-provider reply, and logout removes availability. The subscription-endpoint declaration gap remains separate work. This does not claim that the unmodified subscription endpoint works.

Additional integration contention proof holds Telegram's successful send acknowledgment for 20.904 seconds. During that hold, an unrelated session edit finishes in 14 ms, shared history in 42 ms, catalog read in 48 ms, and allow-list config edit in 1.13 seconds. After release, one shared notice remains through a web reply and restart, without a duplicate answer.

A separate later-release observation found no automatic provider request or new row during 190 seconds. An explicit refresh against a seven-second fake provider exceeded the existing discovery budget and retained the prior rows with a failure status. Thirteen catalog reads during that request took at most 8 ms; thirteen session reads took at most 2 ms. This proves responsive published reads during slow discovery, not successful later-model publication or a browser-open timing. The fast later-release and current browser controls remain due.

Earlier narrow SDK checks, 17-config startup corpus results (including the approved invalid legacy-api rejection), and registered receipt/compaction cases retain their exact source identities. They do not substitute for the outstanding final published-updater, complete older-plugin/native, typed-reference, and integration-tree gates. Prior full CI at a635eacb failed Android formatting and the now-repaired construction case; the dependency check passed on its one infrastructure retry. New-head CI remains required.

Consumers

Contract Producer and consumers Resulting behavior
Selection policy, allowsByList, primary exception src/agents/model-selection-shared.ts; composition src/agents/model-visibility-policy.ts; public facade src/agents/model-selection.ts; selection resolver src/agents/model-selection-resolve.ts One policy decides explicit selection. Authored primaries remain permitted. With no authored primary, a caller’s current session model receives no primary exception. Automatic fallback retention is not manual-selection permission.
Configured primary and subagent inheritance model-selection-shared.ts owns resolveSubagentConfiguredModelSelection; model-selection-shared.ts owns resolveConfiguredModelPrimaryValue; src/agents/model-selection-config.ts resolves defaults The former config-module export moves to the shared owner. Consumers are src/agents/model-selection.ts, src/agents/prepared-model-runtime.configured.ts, src/agents/subagents/spawn/subagent-spawn-plan.ts, and src/config/codex-plugin-diagnostics.ts. The facade retains its public export; there is no duplicate implementation.
Session-scoped default and row identity configured-model-entries.ts, session-model-ref.ts, directive defaults/model; shared projection in src/gateway/session-utils-model.ts, session-utils-projection.ts, session-utils-row.ts, session-utils-contracts.ts History/list defaults and unpinned rows consume the same effective default as the picker. Authoritative no-replacement stays null in defaults; unpinned rows omit model/provider and derived runtime/thinking/fast-mode fields. Stored, inherited, and native-owned selections retain precedence. Per-response default/subagent cache keys stay distinct and cache null separately from an unknown result. Config-only callers without snapshot evidence retain authored diagnostics.
Logical catalog result src/agents/model-catalog-visibility.ts produces { entries, allowList? }; preparation evaluates availability before selection filtering All production callers consume the new result shape: src/gateway/server-methods/models-list-result.ts, src/auto-reply/reply/commands-models-catalog.ts, src/flows/model-picker.ts, and src/commands/doctor/shared/model-policy-allowlist-repair.ts. Earlier source searches found no remaining production references to the retired visibleCatalog policy method or ModelCatalogAuthChecker surface; the current CI merge-tree census must verify that disposition.
Effective default and authored diagnostics resolveEffectiveDefaultModel in src/agents/model-visibility-policy.ts; lower-level policy in model-selection-shared.ts; reply and command selectors; model-catalog-view.ts; Gateway default tags; default directives effectiveDefault: { ref, missingPrimary? } separates executable selection from authored configuration. The synthetic missing-primary row is removed. Replacement requires captured existence and allow-list membership. Native inventory uncertainty, authoritative: false, and refreshFailed preserve prior admission. Config inspection retains the authored ref.
Rebased catalog identity lookup createModelCatalogIdentityKeyResolver in openai-model-routes.ts; local resolvers in shared allowed-set, configured-catalog, and visibility-policy construction Each operation retains the new base’s local identity resolver. No process-wide identity cache or second effective-default owner is introduced by the rebase.
Provider-resolved configured identities ModelCatalogSnapshot.resolvedConfiguredModelRefs; writers prepared-model-runtime.configured-catalog.ts and prepared-model-runtime.full-catalog.ts; refresh projection prepared-model-runtime.catalog-access.ts The effective-default owner consumes this private fact when browse mode omits a resolved model. Scoped materialization, publication, and worker transfer preserve the complete snapshot. The rebased createFullModelCatalogAccess replaces projected configured refs from the current prepared generation; the duplicate build-module implementation is removed. No second cache, database field, or client projection is added.
Gateway wire facts packages/gateway-protocol/src/schema/agents-models-skills.ts defines hiddenCount, settingsPath, optional selectedModelBlocked, and optional ModelsListResult.allowList src/gateway/server-methods/models-list-result.ts publishes facts; chat-metadata-contract.ts, chat-metadata-session-projection.ts, and chat-metadata-runtime.ts carry them into chat and startup metadata. settingsPath is a config-key hint, never a storage path. No wire version or database schema version changes.
Captured chat/default projection facts src/gateway/server-model-catalog.ts and .types.ts; chat-metadata-session-projection.ts; chat-metadata-runtime.ts; chat-startup-projection-contract.ts; chat-history-handler.ts Private prepared projections carry the full snapshot and manifestPlugins from the same owner. History reuses the startup pair or the existing passive prepared reader, before its current-session/sharing recheck. Display entries alone do not establish absence. Current selection still owns the blocked overlay; no raw snapshot or new field is spread onto the wire.
Session-list cache and search consumers src/gateway/session-utils-list.ts passes its per-agent prepared map to session-utils-search.ts; server-methods/sessions-list-cache.ts owns the existing cache fence Search uses the row's effective selected model for an unrun session, preserving actual recorded model history where present. It does not recreate replacement policy or invent runtime fields for an absent selection. The cache includes captured metadata, snapshot presence/authority, live refresh failure, and resolved configured refs as well as rows/provider policy; a new wrapper alone is not invalidation.
Web chat ui/src/pages/chat/chat-state-host.ts, chat-state-page.ts, chat-state-refresh.ts, chat-pane-session-controls.ts Metadata stores and clears the policy facts with the catalog. components/chat-model-controls.ts avoids adding the blocked pin as a selectable row. components/chat-model-picker.ts renders hidden/empty/blocked guidance and the existing settings action. ui/src/lib/chat/model-select-state.ts prefers the published default tag, then existing agent/session defaults.
New-session web picker ui/src/pages/new-session/model-control.ts Draft metadata uses the same wire facts and model controls. It does not invent a session pin or a second selection policy.
Telegram src/auto-reply/reply/commands-models.ts through extensions/telegram/src/bot-handlers.callback-router.ts and extensions/telegram/src/model-buttons.ts Initial provider menus, model pages, and Back carry the shared facts and session key. Existing login/readiness and refresh notices remain. The plugin imports the existing provider-data type; it does not add a new runtime SDK formatter dependency.
Provider setup without model choices commands-models-catalog.ts uses the captured owner.metadataSnapshot and existing decisions.evaluateEntry; Telegram callback router/model keyboard and Mattermost provider/page renderer consume existing provider notices An absent authored primary may expose its provider setup with zero models. It never enters catalog rows, name maps, or allowed refs. Empty pages offer only Back. Selection still checks actual model-set membership. Main’s pending-provider filtering/checking notices remain independent of setup guidance.
Discord extensions/discord/src/monitor/model-picker.view.ts; native-command-model-picker-ui.ts; native-command-model-picker-interaction.ts Provider/model interactions use the effective bound route and session key. Rendering consumes shared facts; selection remains in the registered model command. Existing component authorization and route ownership remain in their owners.
Android wire and state apps/android/app/src/main/java/ai/openclaw/app/GatewayModelCatalog.kt; catalog parsing; chat/ChatController.kt Parser carries allow-list facts and row tags. Controller updates and clears both catalog and policy state together. NodeRuntime.kt and MainViewModel.kt expose the state. ui/chat/ChatScreen.kt renders the notice and retains the reset action. No device-rendering result is inferred from source.
Apple wire and state apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift; OpenClawChatUI/ChatGatewayPayloadCodec.swift; ChatTransport.swift; ChatSessions.swift Optional allow-list data and optional tags decode into the existing chat snapshot. Older results that omit them remain decodable. ChatViewModel+ModelControls.swift publishes facts, formats notices, and resolves catalog defaults; ChatViewModel.swift clears session-owned state.
Apple rendering ChatComposer+Controls.swift; ChatComposer+CleanControls.swift; apps/ios/Sources/Design/ChatModelControlsMenu.swift Menus render the policy notice and preserve a reset action. Shared option renderers use the published default identity. iOS places the resolved default label in the reset action's accessibility hint. Native device rendering and accessibility proof remain distinct from codec tests.
Web locale ownership ui/src/i18n/locales/en.ts; scripts/lib/control-ui-i18n-catalog.ts; ui/AGENTS.md internationalization rules Four English keys own hidden/empty/blocked/repair text. Locale adapters consume canonical generated memory through their existing registry. Source verification and the post-merge translation workflow have separate duties; this source change does not hand-edit translation memory.
Native locale ownership apps/.i18n/native-source.json; scripts/native-app-i18n.ts; .github/workflows/native-app-locale-refresh.yml Source inventory owns the new stable strings. After merge, the serialized workflow generates NativeStringResources.kt, Android values*/strings.xml, native locale artifacts, and Apple Localizable.xcstrings. verify checks source inventory/platform wiring; check also checks locale/generated state. Missing fresh translations are pending generated work, not a runtime failure: NativeStrings.kt formats unmapped English source. English projection and final generated-locale checks still need their own evidence.
Blocked-pin and missing-primary reply state src/auto-reply/reply/model-selection.ts; get-reply-directives-apply.ts; forwarding through get-reply-directives.ts, get-reply.ts, get-reply-native-slash-fast-path.ts, get-reply-run-execute.ts, queue/types.ts; directive-handling.impl.ts, .model.ts, .model-selection.ts User pins remain stored. The shared effective default reaches ordinary selection and /model default; effectiveDefaultRef drives default tags. missingConfiguredPrimary is turn-local. Authorized model changes clear pending recovery state. /model and /models remain recovery paths when no allowed default exists.
Recovery execution and automatic fallback candidates agent-runner-run-params.ts; agent-runner-run.ts; agent-runner-execution.ts; embedded/CLI/fallback candidate adapters; agent-runner-memory.ts; embedded-agent-runner/run-entry.ts; model-fallback-runner.ts; model-fallback-candidates.ts Pending explanations use final-only delivery and existing reply-dispatch completion. Blocked pins retain an empty fallback chain. Ordinary missing-primary recovery passes its canonical exclusion to the candidate owner, which filters it after alias resolution and includes it in the cache key. Other configured fallbacks retain order and route provenance.
Command-line agent path and auth src/agents/agent-command.ts; command/model-selection.ts; command/model-selection-auth.ts; command/session-transcript.ts; command/run-embedded-attempt.ts; command/post-run.ts; command/delivery.ts; reply auth in get-reply-run-admission.ts Direct commands consume the same effective default and missing-primary exclusion. The replaced primary's raw auth-profile suffix is not inherited. Captured manifestMetadataSnapshot still reaches resolveCommandSessionAuth through the selector. Existing transcript persistence supplies the actual assistant ID; output/delivery acknowledgments use the shared publication owner.
Heartbeat profile forwarding from main src/auto-reply/reply/get-reply.ts parses the configured heartbeat ref and profile suffix, then forwards configuredProfileId only while provider/model still match the run The rebase preserves main’s existing profile capture, explicit-switch clearing, and guarded forwarding. This correction does not introduce another heartbeat credential owner.
Manual compaction get-reply.ts and get-reply-native-slash-fast-path.ts → handleInlineActions in get-reply-inline-actions.ts → HandleCommandsParams in commands-types.ts → commands-compact.ts; runtime owners compact.types.ts, compact.ts, compact.queued.ts, compaction-runtime-context.ts, compaction-runtime-preparation.ts Both command paths forward the existing missingConfiguredPrimary fact. During missing-primary recovery, compaction does not copy the absent authored primary's auth-profile suffix onto the effective default; an available authored primary retains its explicit profile. useSelectedModel still excludes the configured compaction override and fallback ladder. Actual native bindings remain refused before cross-runtime compaction. A notice requires sessionCompaction.compacted === true. No new policy decision or persisted fact is introduced.
Notice formatting and durable receipt src/auto-reply/reply/model-policy-notice.ts; src/config/sessions/types.ts; src/sessions/model-overrides.ts; session-snapshot-merge.ts; src/plugins/session-entry-slot-keys.ts Formatters bind the explicit notice prefix and existing {sessionId,pinnedModel} receipt operation. The receipt requires successful delivery, exact transcript persistence/publication, and current authority. Errors/silence do not consume it. Existing selection-change clearing and stale-snapshot protections remain.
Notice publication and final delivery New src/auto-reply/reply/model-notice-publication.ts; existing callback metadata in reply-payload.ts and src/infra/outbound/payloads.ts; consumers dispatch-from-config.finalize.ts, chat-send-reply-dispatch.ts, chat-send-reply-finalization.ts, command delivery bindModelNoticePublication and persistModelNoticeTranscript own one composed notice and one pending publication. Defer/wait/settle functions move here from the formatter. Channel/direct acknowledgments and Gateway finalization use that owner; follow-up admission joins completion. Failed cleanup releases waiters without recording delivery or retrying the same persistence attempt.
Canonical transcript reconciliation New src/config/sessions/transcript-assistant-rewrite.ts; session-accessor.sqlite-transcript-write.ts; chat-send-reply-dispatch.ts; chat-send-source-finalization.ts; remaining Gateway adapters in chat-transcript-persistence.ts Turn capture, exact entry/key/legacy-media matching, and observed publication move to the shared owner. Channel/CLI notice transformation prepends the explicit prefix to original canonical/display text, preserving media/control data. Gateway supplies its existing rich-display transform. Live session/lifecycle/writer/pin checks, generation, sequence, and exact row bytes fence mutation. Missing identity permits no append.
Doctor proposal, consent, and write src/commands/doctor/shared/model-policy-allowlist-repair.ts; doctor-config-flow.ts; doctor-prompter.ts; doctor-repair-mode.ts; doctor/finalize-config-flow.ts; normal config writer Inspection follows the existing repair-or-preview phase so credential migration can run first. Only AuthProfileMigrationRequiredError becomes a visible deferred-inspection warning with unchanged config; other failures propagate. Historical metadata identifies an offer, never consent. Exact before/after policy and separate interactive consent still precede admission to the existing write plan. Generic repair may perform other authorized repairs but cannot accept wildcard expansion.
Migration marker src/config/model-policy-allowlist-migration.ts; src/config/io.meta.ts; schema/type/label consumers in zod-schema.root-shape.ts, types.openclaw.ts, schema.labels.ts Handwritten explicit lists no longer acquire a fresh generated-list marker from an ordinary write. Existing marked states remain readable. Previous-release writers can already have marked handwritten lists, so the runtime never treats the marker as consent.
Contract Producer and consumers Resulting behavior
Command catalog projection commands-models.ts retains published-owner lookup, parsing, rendering, and dispatch; commands-models-catalog.ts owns the private projection, runtime-choice and readiness-menu builders; commands-models.types.ts owns their shared types One projection adapter consumes the same captured config/catalog/auth/manifest facts. The type-only leaf includes the private session-entry view and provider/menu/browse contracts; the existing public command export remains. Plugin SDK contracts stay unchanged. Post-await owner-currentness checks remain.
Admitted catalog identity Gateway agent-run-execution-phase.ts → agent-run-dispatch.ts → agent-command.ts; command/model-selection.ts and command/run-embedded-attempt.ts; prepared-model-catalog.ts Existing commandRuntimeContext.config reaches exact catalog reads as catalogOwnerConfig. Resolved command cfg still controls policy, secrets, native augmentation, execution, and delivery. Initial and fallback thinking reads use the same identity. Exact-config matching stays enforced; other callers omit the field and retain existing behavior.
Final-publication owner Private ReplyPayloadMetadata.hostFinalReply; sole writer embedded-agent-runner/run/settled-turn-finalization.ts; sole selector gateway/server-methods/chat-send-source-finalization.ts Host-finalized answers retain their publication owner. Ordinary streamed answers can carry writer authority without being published a second time. The marker grants no delivery authority; live session/writer checks remain mandatory. Generic metadata copy/merge preserves it; durable pending-delivery serialization keeps its separate existing contract.
Transcript publisher result publishAssistantTranscriptRewrite in config/sessions/transcript-assistant-rewrite.ts; notice publication plus existing keyed/media/source rewrite callers The notice owner consumes successful publication before its receipt. Existing media/source callers may ignore the boolean because their flags record an already committed row rewrite, not notification or delivery. They retain independent final-delivery authority checks; no failed publication causes another append.
Structural helper cutovers session-utils-model.ts inlines its sole-caller thinking-level forwarding helper; directive-handling.impl.ts uses one complementary persistence branch The same thinking owner, arguments, cache, level projection, write order, and acknowledgement order remain. No new cache, lock, fallback, or policy is introduced.
Catalog type and runtime helper ownership manifest-model-id-normalization.types.ts owns the normalization-source type; command/session-helpers.ts owns settleAgentPrimaryProbe; compact.queued-execution.ts owns buildCompactionContextEngineRuntimeContext; doctor-config-analysis.ts owns the internal-hook warning helper Type readers no longer depend on the runtime normalization module. Existing probe settlement, current-entry persistence checks, compaction runtime projection, and warning behavior move to their existing functional owners. The old local bodies are removed; no competing state owner is added.

Physical transcript identity consumers

Contract or stage Exact producer/readers Resulting behavior
Physical assistant persistence and terminal event src/agents/sessions/agent-session-base.ts; event type src/agents/sessions/agent-session-types.ts The append owner returns the physical row ID. Each agent_start clears it; each assistant append replaces it, including absence after suppression; agent_end emits it. This is existing producer behavior, now consumed by reply reconciliation.
Suppressed persistence src/agents/session-tool-result-guard.ts A blocked or intentionally suppressed assistant write returns no physical ID. Ownership remains with the runtime. Missing ID does not authorize a duplicate Gateway append.
Subscription and terminal callback src/agents/embedded-agent-subscribe.handlers.types.ts; embedded-agent-subscribe.handlers.lifecycle.ts; embedded-agent-subscribe.types.ts; embedded-agent-subscribe.ts Lifecycle resets and terminal events replace the optional field, including absence. The getter exposes the current ID; the pre-delivery callback retains the existing physical-ID contract.
Existing revision consumer src/agents/embedded-agent-runner/run/attempt-stream-prepare.ts Terminal revision requires a persisted assistant entry and records that exact ID. It does not invent an ID for suppressed output. Retry/revision replacement proof remains a separate execution gap.
Attempt snapshot and callers src/agents/embedded-agent-runner/run/attempt-result.ts; caller attempt-settle.ts; result type run/types.ts completeEmbeddedAttemptResult captures identity before output-hook reentry. Runtime ownership follows the completed assistant independently of physical persistence.
Finalization contract and projection src/agents/harness/types.ts; harness/settled-turn-finalization-result.ts; src/agents/embedded-agent-runner/run/settled-turn-finalization.ts The narrow result carries optional identity only with runtime-owned persistence. The projection retains owned absence and does not substitute a stream index. Core carries the finalizer's identity into its result.
Public plugin SDK and bundled callers src/plugin-sdk/agent-harness-runtime.ts; src/agents/harness/builtin-openclaw.ts; extensions/copilot/harness.ts; docs/plugins/sdk-agent-harness/sessions-and-results.md The SDK exports the result type and projection helper. Built-in and bundled harnesses consume that projection. The canonical result guide explains ownership, physical identity, intentional suppression, and absence. Six shipped-host helper/type cells passed at 9f07a237, and the public type/projection/export are unchanged in f3213191. This closes the optional-field compatibility concern while leaving complete bundled-plugin loading and broader previous-state behavior separate.
Terminal payload and metadata src/agents/embedded-agent-runner/run/terminal-preparation.ts; run/payloads.ts; src/auto-reply/reply-payload.ts Identity flows with the final payload, separately from runtime ownership. The run/ paths in this row are under src/agents/embedded-agent-runner/.
Incomplete-turn classification src/agents/embedded-agent-runner/run/incomplete-turn-classification.ts Correlation identity alone is not evidence of visible delivery.
Captured notice boundary and embedded settled writer captureAssistantTranscriptRewriteStart in src/config/sessions/transcript-assistant-rewrite.ts; callers agent-runner-execute.ts, command/run-embedded-attempt.ts; custody through agent-runner-fallback-candidate.ts, agent-runner-fallback-cycle.types.ts, agent-runner-execution.types.ts, agent-runner-execution.ts, agent-runner-result-payloads.ts Captures the pre-turn session/generation/sequence. Each candidate clears prior custody; a durable settlement supplies its actual target even when compaction count is zero. settledWriter remains internal and separate from compaction counting. Direct commands use their existing retained settlement fact.
Private CLI writer custody CliHistoryWriter in src/agents/cli-runner/history-boundary.ts; cli-runner.ts → bindCliRunSettledWriter in new cli-runner/settled-writer.ts; copy consumers cli-runner/run-diagnostics.ts, agent-runner-cli-dispatch.ts; reader agent-runner-cli-candidate.ts A WeakMap retains copied, frozen target/lifecycle/expected-writer facts across diagnostic and reasoning result copies. The candidate reads custody before continuity decoration and forwards it to the common settled-writer path. Unknown history authority supplies no fact. No property is added to the public result or wire shape.
Gateway final consumers and fallback capture src/gateway/server-methods/chat-send-reply-dispatch.ts; chat-send-reply-finalization.ts; existing writer-delivery metadata in src/auto-reply/reply-payload.ts Original scalar session/lifecycle/writer/pin expectations are captured before media awaits. Runtime-issued context takes precedence over Gateway fallback context. Exact owned identity targets the shared notice rewrite; final publication rechecks delivery authority and does not append a second row.
Shared exact-row writer and retained media paths src/config/sessions/transcript-assistant-rewrite.ts; src/config/sessions/session-accessor.sqlite-transcript-write.ts; Gateway keyed/mirror adapters in chat-transcript-persistence.ts Notices use a physical entry ID or explicitly runtime-owned key; a bad physical ID cannot fall through to another identity. Ordinary media retains its ordinal-plus-exact-media contract. Shared helpers resolve within the captured sequence/generation; the SQLite writer checks current authority in its transaction and compares original row bytes. Publication reports observed success.

Historical source searches covered src/, extensions/, ui/, apps/, docs/, and packages/. Their terminal-identity, private CLI-custody, and retired-symbol findings remain in the retained evidence. The current lexical merge-tree dispositions are listed below; typed-reference execution and final gate reconciliation remain pending. Earlier searches exempt no current match or new caller. The consumer tables above remain the contract inventory to check.

Lexical census dispositions on the current integration tree

Fresh source review covers all 35 reported locations on merge 0e676708b602439b65430a7b0c66472f547f7ed4, tree 85b9d0476cbc332c405a81bc1ac609115c68f8a6. Counts include declarations, imports, and test labels, not only executable calls. No stale consumer was found in this inventory; typed-reference coverage is a separate pending gate.

  • includeAgentPrimary: src/agents/model-selection-shared.ts:47,53 owns the unchanged optional boolean; src/agents/model-selection.ts:281,288 exposes and forwards it; src/agents/prepared-model-runtime.configured.ts:342 deliberately excludes the already-prepared agent primary.
  • ManifestModelIdNormalizationSource: type imports/uses moved to the declaration leaf at src/plugins/manifest-model-id-normalization.types.ts:7; consumers are src/agents/model-ref-shared.ts:16,29, src/gateway/server-methods/chat-startup-projection-contract.ts:2,19, and src/gateway/server-model-catalog.types.ts:3,11. The original normalizer's migrated import/use at src/plugins/manifest-model-id-normalization.ts:7,21 was also inspected; the scanner excludes that removed-declaration file, so these two are additional to its seven locations. The record and owner-map shapes are unchanged.
  • publishAssistantTranscriptRewrite: the sole declaration is src/config/sessions/transcript-assistant-rewrite.ts:166. src/auto-reply/reply/model-notice-publication.ts:8,169 imports it and checks the result with current authority before a receipt. Migrated callers are src/gateway/server-methods/chat-send-reply-dispatch.ts:25,425,476 and src/gateway/server-methods/chat-send-source-finalization.ts:7,388; their existing media/source paths await publication without interpreting its boolean as delivery acknowledgment. The deleted Gateway declaration has no caller.
  • resolveSubagentConfiguredModelSelection: sole owner/caller at src/agents/model-selection-shared.ts:44,66; preserved facade import/export/call at src/agents/model-selection.ts:38,50,285; runtime preparation at src/agents/prepared-model-runtime.configured.ts:43,339; spawn provenance at src/agents/subagents/spawn/subagent-spawn-plan.ts:12,96; diagnostics at src/config/codex-plugin-diagnostics.ts:22,103; test import/label/cases at src/agents/model-selection.test.ts:33,3185,3209,3225. Precedence and string/object normalization remain unchanged; one implementation serves every reader.

census: generic includeAgentPrimary reviewed — 5 callers listed
census: generic ManifestModelIdNormalizationSource reviewed — 7 callers listed
census: generic publishAssistantTranscriptRewrite reviewed — 8 callers listed
census: generic resolveSubagentConfiguredModelSelection reviewed — 15 callers listed

The removed mergePreparedConfiguredCatalog, ModelCatalogAuthChecker, and rewriteAssistantTranscriptMessageByTurnIndexAndMedia names have no remaining match on this integration tree.

Effective-default and Doctor completeness correction

  • ModelsProviderData.effectiveDefault is a captured policy fact: an object names the usable default, explicit null means none, and absence identifies an older producer. The required authored resolvedDefault construction shape remains unchanged. commands-models-catalog.ts writes the fact and Default names; commands-models.ts consumes it for list text. The SDK barrels continue exporting the same type without a new mandatory runtime import.
  • Telegram's registered callback router consumes the captured default for current-label fallback and applySessionModelSelection; it no longer recomputes the default from raw config. Existing session pins and compatible auth profiles keep their own state owners.
  • Discord's existing model-picker.runtime.ts adapts old-field absence. Its view consumes the result for Default text, reset, and recents; its interaction owner consumes it for navigation/reset/recents; its UI owner consumes it for current selection and native argument/autocomplete context. The apply owner reports success only after observed selection matches. An absent selection gets visible text, never a sentinel model id. Default retains its reserved recent slot when absent.
  • Mattermost's model-picker owner consumes the same fact for current model/provider fallback. Registered interaction and slash response owners render that result. Old-shape inputs remain supported; explicit null never falls back to the authored missing name.
  • resolveEffectiveDefaultModel reuses canonical isCliProvider to recognize registered process backends separately from harness policy. Agent command selection, auto-reply/reset, catalog projection, and compaction consumers retain the same policy owner. A nonempty native catalog still establishes model withdrawal; a host-only inventory cannot establish that a process backend removed a model.
  • prepareDoctorModelPolicyAllowlist remains called by doctor-config-flow.ts. It acquires the existing scoped read-only live catalog for relevant enabled providers and feeds that same snapshot to decisions, visibility/counts, and diagnostics. Failed/pending/incomplete catalog outcomes defer inspection. Replace-mode authored inventory retains its existing path. No catalog-owner API, storage schema, migration, config key, or protocol version changed.
  • The new channel and Doctor text follows the existing English channel/admin output paths; these backend strings have no locale-resource mapping. Web/native wire schemas do not consume ModelsProviderData. The SDK compatibility guide documents old producer absence versus explicit null.
  • The typed-reference manifest now includes 212 declarations/signature anchors, preserving the original 192 and covering the additional consumers and moved internal runtime-token helpers. Collection remains pending; the manifest is not a coverage verdict.

Invalidation

Derived state Invalidation/read owner Required proof and present evidence
Prepared catalog, existence facts, and effective default Existing prepared-owner lifecycle and src/gateway/server-chat-metadata-lifecycle.ts; chat-metadata-runtime.ts compares config, owner/catalog identity, plugin version, auth revision, and skills version Primary/provider-row/alias edits, agent/subagent scope, replacement mode, runtime/plugin changes, credentials, refresh/withdrawal, reload, and restart invalidate the owned facts. Final proof must include failed discovery, valid dynamic/native models, and known models with missing credentials.
Auth and skill subordinate facts server-chat-metadata-lifecycle.ts waits for coherent prepared-owner publication, then invalidates and refreshes New login/logout and replacement-owner races need current evidence. Personal-account projections are request-local where the runtime selects that mode.
Session blocked/default overlay and history projection chat-metadata-runtime.ts carries current selection plus the captured snapshot/manifest pair; shared session projection handles unpinned defaults Stored/inherited/native selection changes and main/subagent scope must not borrow another row's result. Missing snapshot evidence differs from an authoritative null replacement. History/startup/list defaults and selected rows must agree with the picker on the final projection build.
Completed/in-flight session-list results and search Existing sessions-list-cache.ts fence; per-response SessionListRowContext; session-utils-list.ts → session-utils-search.ts Invalidation includes row/provider-registry/manifest identity, snapshot presence, authority value, live refreshFailed, and resolved-configured-ref identity. The live status value must be read even if object/row identities are stable. Unchanged facts still reuse the cache. Search receives the same per-agent map, preserving recorded history but not attributing an absent or stale authored model to an unrun session.
Client catalog/policy state Web chat-state-refresh.ts; Android ChatController.kt; Apple ChatViewModel.swift; new-session metadata scope Disconnect, agent/session switch, account change, refresh, and restart must clear or replace both model rows and policy facts. Native source/codec coverage is not proof of a rendered device.
Notice receipt and publication model-policy-notice.ts receipt writer; model-notice-publication.ts publication; existing model-override clear and snapshot-merge owners Same-pin receipt survives restart only after delivery and transcript publication. Pin/session changes invalidate it; policy/catalog refresh alone does not. Failed, suppressed, missing-row, or stale publication must neither create a receipt nor strand follow-up work.
Transcript target and settled custody transcript-assistant-rewrite.ts; runtime-issued embedded/CLI writer facts; model-notice-publication.ts Session rotation, same-ID lifecycle reset, writer/pin changes, transcript generation/row changes, missing physical identity, and candidate replacement invalidate publication. Private result copies preserve the same captured custody; they do not refresh authority.
Missing-primary fallback exclusion model-fallback-candidates.ts includes the canonical missing ref in its existing cache key; explicit model switches clear the turn fact Direct and aliased missing refs must never be requested after replacement failure; remaining candidates preserve their order. Blocked-pin recovery retains its empty chain.
Manual compaction credential choice Existing turn-local missingConfiguredPrimary from model selection, forwarded through ordinary and native-slash inline actions to commands-compact.ts The missing-primary fact excludes the stale authored profile for this compaction. Available authored primaries retain their explicit profile. No additional stored state, cache, or invalidation lifecycle is introduced. Both real Gateway cases passed at f3213191, including exact provider credentials and unchanged stored user pin.
Admitted catalog identity Gateway run admission and existing prepared-model owner Config/credential/plugin replacement and shutdown retain the existing admission and owner-currentness checks. A resolved secret overlay is not a new catalog identity; this handoff adds no cache.
Final-publication ownership Settled finalizer and private payload metadata Each new payload carries its actual publication owner. Copies preserve the fact; it is not inferred from writer authority or retained across durable restart queues.
Locale resources Source inventory/key changes trigger their serialized generated workflows English fallback is supported. Generated translation parity is certified by the generated-output/release gate, not by source inventory alone.

Contention

Held owner Other operations sharing it Assessment
Metadata preparation refreshTail, pending generation, replacement gate (chat-metadata-runtime.ts) Metadata/list/startup reads join a pending replacement; requests can reuse ready projections Warm reads publish synchronously from prepared facts. A read can wait for lifecycle replacement; opening a picker must not start provider discovery. Historical slow-provider timings are recorded below.
Prepared provider guidance (commands-models-catalog.ts) Provider-menu projection shares captured auth decisions, current prepared metadata, and main’s pending-provider lifecycle The absent-primary readiness query uses the existing read-only auth owner. It starts no discovery or credential refresh and adds no lock or retry loop. The owner-currentness check remains after awaited evaluations. Focused tests do not establish final contention timing.
Session-default/list/search projection and existing list cache History/startup, list/describe rows, and search share captured prepared facts Effective selection and cache-fence construction are synchronous; per-response row maps add no write lock. History's optional fallback reads the existing published catalog and rechecks current session/sharing afterward. No provider discovery or new polling/cache owner is added. Stable-row cache-status transitions and final latency remain execution gates.
Session execution/admission and manual compaction session/global lanes (compact.queued-execution.ts) Same-session turns and compaction; global lane peers The selected model's expensive compaction runs inside these lanes. Unrelated picker reads and config writes must remain responsive. The lane names alone do not prove latency.
SQLITE_SESSION_WRITER_QUEUES, keyed by store path (session-accessor.sqlite-scope.ts) Receipt patches, session edits, transcript rewrites, checkpoint/archive/delete writers for the same store Receipt patching uses patchSessionEntryCore and holds the store write queue during preparation. Its updater is synchronous, then a short SQLite write transaction revalidates the lifecycle snapshot (sqlite-entry.ts). No provider request is part of the receipt callback. A competing session edit must still be measured while delivery settles.
Shared transcript write ownership (transcript-assistant-rewrite.ts; session-accessor.sqlite-transcript-write.ts) Appends, media reconciliation, compaction and transcript mutation for the same logical transcript/store Existing queue/transaction owners are reused. Cold restoration precedes writer admission; the commit predicate and row mutation are synchronous. Media preparation and network delivery occur outside the transaction. Marker and receipt are separate short writes with authority rechecks, not one atomic transaction. Existing Gateway media/mirror locks remain with their adapters.
Config mutation queue and file lock (src/config/write-lock.ts; src/config/mutate.ts) Doctor writes, config.patch, normal config writes and include-owned edits Doctor inspects and asks for consent before its write plan. Existing root/include writer owns the commit and source checks. Catalog reads do not acquire this lock. Historical concurrent config CLI and catalog-read measurements are recorded below.
Deferred final publication (model-notice-publication.ts; dispatch-from-config.finalize.ts) Follow-up admission joins delivery acknowledgment and transcript publication One pending operation is shared. Success authorizes the existing receipt; failed/suppressed publication releases the wait without marking delivery. The private CLI custody transfer adds no lock. Registered success, restart, and failure/retry cases passed at exact f3213191. Final live/concurrent-session latency proof remains separate.

Earlier measured concurrent proof: models.list client calls finished in 877 ms and 902 ms while a seven-second fake-provider turn was active; server method times were 5–6 ms. The config CLI finished in 2046 ms, including process startup, and reported a live reload without restart. Warm picker opening took 33 ms. These results retain their original captured identity; they do not certify contention introduced by the later shared-publication correction.

Tests

Retained base-owned Doctor failure

test/doctor-model-allow-list.e2e.test.ts keeps does not offer a change for deprecated-only exclusions, including its expected no-offer result. It is not skipped or inverted. Live catalog assembly loses the installed manifest's deprecation metadata, so Doctor counts those entries as hidden. The same catalog defect reproduces on base b25510f18d403bc274ebad9a3bb03f6af6040fc9 and tested candidate 998ff128b8c3d046a8757c2d4ea1b68d62b85afc.

Base reproduction uses the same recording endpoint and fake credentials at the declared provider host: openclaw config set agents.defaults.modelPolicy.allow '["mistral/*"]' --strict-json, followed by openclaw models list --refresh --json (default view, no --all or provider filter). Both CLI commands exit 0 but the list exposes the two deprecated entries; the diagnostic asserting their exclusion exits 1 on both base and candidate. The complete-roster Doctor control permits every active entry and excludes only those two entries, still producing the unwanted offer while leaving config bytes unchanged.

Independent source and raw-evidence review confirms this is a pre-existing catalog-owner defect. Ayaan assigned it to a separate queue item and explicitly authorized publication with this failure retained. It is not part of this PR's repair scope or a claimed pass. The final verdict, exact-head review, and merge grant remain required.

Test or suite Registered boundary and protected behavior
test/doctor-model-allow-list.e2e.test.ts Actual Doctor CLI: legacy-credential preview defers inspection without changing config/credential bytes; repair migrates credentials before the offer. Three existing preview/generic-flag cases preserve policy. All four passed at 1703e9c6 and exact f3213191; interactive accept/decline proof is retained separately.
test/model-policy-compact-auth.e2e.test.ts Real Gateway chat.send /compact with recorded provider requests: missing cross-provider primary and available explicitly pinned primary. Requires successful compaction through the effective default's credentials and preservation of the stored user pin. The missing-primary case is red on 9f07a237, its valid-primary control is green, and both passed at exact f3213191.
test/model-default-missing-primary.e2e.test.ts Three cases passed at exact f3213191. Real chat.send, config CLI, chat.history, models.list, sessions.list, and agent --local: typo, withdrawn primary, blocked pin, provider request identity, delivered notice/default tags, null no-replacement defaults, and used/unrun search behavior.
test/model-policy-receipt.e2e.test.ts Two cases passed at exact f3213191. Registered Gateway turns, config edits, history, restart, and media: exact ordered rows, one notice, and preserved pin.
test/model-policy-telegram-history.e2e.test.ts Four cases passed at exact f3213191. Real registered Telegram webhook and Bot API fixture: text/photo shared history plus two HTTP 403 cases. Failed notice delivery remains retryable; a separate later diagnostic failure preserves a delivered/persisted notice receipt. Fresh retries and restart retain exactly one notice. This is channel-boundary fixture proof, not a live account or partially delivered message-chunk claim.
src/commands/agent.test.ts Registered agentCommand uses the real run-attempt handoff for the receipt case. The model double persists through the supplied user recorder and assistant append owner, returns the physical ID, and retains exact pin/auth and two-assistant-row assertions.
src/agents/openclaw-tools.session-status.test.ts Registered session_status.execute: no authored primary plus an exact list must reject the excluded stored pin, make no write, then accept/persist an allowed replacement. Rejected intermediate source and three-state proof remain retained.
src/gateway/server-methods/chat.abort-live-proof.test.ts Real Gateway late abort after durable final: one final event, one persisted/reopened row, refused late abort, and settled terminal outcome. The original assertion is unchanged.
src/gateway/server-methods/chat.directive-tags.test.ts Registered chat.send: physical/key identity, missing identity, queued writer/lifecycle revocation, changed-pin refusal, post-receipt rotation, genuine host-finalized fallback, and stale-writer refusal. The changed-pin case requires unchanged canonical transcript/watermark and no stale visible final. Ten selected authority cases passed on the corrected working snapshot.
src/agents/agent-command.live-model-switch.test.ts The actual prepared-catalog owner supplies captured inventory; provider-scoped reads supply thinking capability. Exact admitted config, one read-only prepared lookup, fallback/live-switch behavior, and capability assertions remain. All 136 cases passed on the corrected working snapshot.
ui/src/e2e/chat-model-controls.e2e.test.ts Existing pointer and keyboard account-switch cases both passed on base and candidate working snapshot. The earlier CI pointer navigation failure remains unreproduced and unclassified. No test or product behavior was changed to obtain the two-case results.
src/agents/subagents/spawn/subagent-spawn.production-boundary.test.ts Registered sessions_spawn through Gateway agent admission and command execution: descendant lineage/authority and one actual model invocation. The test is unchanged by catalog identity handoff.
Goal, Talk, preview, and model-list Gateway suites Existing registered request paths retain their exact admission, cancellation, ownership, history, auth, and unavailable-state assertions. Explicit fixture model data replaces an ineffective discovery mock; expected Default tags follow the effective default.
Command/Telegram/Mattermost model-menu suites Registered command/callback/renderer boundaries: captured metadata, provider-only sign-in guidance, no synthetic model choice, Back-only empty pages, and existing pending-state behavior.
Harness result, web picker, Android, and Apple suites Runtime identity/owned absence; rendered web policy guidance; native decoding and coupled catalog/policy state. Native device and generated-locale validation remain distinct duties.

Test deletion and revision ledger

  • Doctor: obsolete helper-only expectations of automatic wildcard widening are retired. Actual CLI refusal and interactive accept/decline evidence replace the applicable cases. The deprecated-row offer-negative case is now retained at the registered CLI entry point; its base-owned failure is dispositioned above and remains visible.
  • Delivery-only CLI suppression: removed delivery.test.ts case “shows the blocked-pin notice once after CLI output without changing the pin.” Its in-memory payload had no owned transcript, so output alone could not validly consume a receipt. Registered Gateway/Telegram receipt tests and the corrected real agentCommand receipt case cover delivered, persisted explanations.
  • Partial-send helper rows: removed the two “acknowledges only the policy payload that actually sent” rows that manually reported send outcomes without an owned transcript. The new registered Telegram HTTP 403 cases exercise actual notice failure and a distinct later-payload failure. Generic cancellation, partial-delivery, retry-state, and sentBeforeError tests remain. Channel proof does not certify direct CLI partial-send indexing or partial message chunks.
  • Native pin isolation: agent-runner.misc.runreplyagent.test.ts retains primary execution, unchanged native pin/profile, no inherited native authority, and no fallback ladder. Its nonpersisting runtime must leave the receipt absent even after acknowledgment; the next notice remains eligible.
  • Direct CLI fixture: the receipt test uses the existing real-attempt option, supplied recorder, and physical assistant ID. Its earlier missing-recorder failure remains retained. Exact stored pin/auth and canonical row assertions are preserved.
  • Catalog ignorance: command/maintenance/normalization stubs explicitly identify unacquired inventory; they do not redefine authoritative-empty behavior. Goal/Talk now use complete explicit provider rows through config IO, removing the unused discovery seed. Aggregate preview supplies both agents' real fixture rows before owner preparation. All invariant assertions remain.
  • Normalization and tags: command fixtures delegate normalization/alias pairs to their real owners. Model-list expectations add Default while retaining unavailable reasons, SecretRefs, fallback/configured tags, alias output, and physical route assertions. Native ready projection now requires the captured snapshot/manifest pair.
  • Structural consolidation: two invalid-pagination tests become table rows with both original inputs and the same rendered result. Auth-label assertions retain provider/workspace/output while removing unsafe casts. The command projection split moves existing bodies; thinking forwarding and complementary directive branches preserve behavior.
  • Physical identity and publication: exact entry/key/missing/rotation/queue checks remain. Two existing host-finalizer fixtures gain the producer's private marker without relaxing live-writer denial or no-duplicate assertions. Retired needsModelCatalog fixture fields and obsolete comments are removed; existing degraded-catalog and no-second-discovery checks remain.
  • Assertion baseline maintenance: only reductions are accepted for the two transcript owners (2→0 and 7→3). Unrelated generated increases were rejected. No allowance, retry, timeout, expected-failure, or snapshot exception was added to accept a regression.
  • Notice helper authority: the old in-memory storage mock could create a receipt without transcript publication authority. It is removed. Formatter tests now require a repeated notice without authority and cover matching/mismatching recorded receipts. Real Gateway key/entry, queued-revocation, rotation, and new changed-pin cases retain the stale-publication contract; the ten-case authority run passed.
  • Live-switch catalog fixtures: the mock moves to prepared-model-catalog.ts, the module that owns the read. The unused full-catalog tripwire is removed. Assertions now require one exact read-only prepared lookup, while provider-scoped thinking reads retain capability behavior. The initial fixture failures and intermediate full-suite failure remain recorded; the corrected full suite passed 136 cases.
  • Compaction credential regression: no existing case was deleted or weakened. The new two-case real Gateway test preserves the valid explicit-profile control beside the missing-primary regression. The correction reuses the existing turn fact across five production files; both cases passed at exact f3213191 after the missing-primary case failed at 9f07a237.

Removed coverage: exact dispositions

Removed or consolidated case Retained contract, replacement, or explicit gap
model-selection.test.ts: “keeps literal wildcard rows and exact entries with the first duplicate's metadata”; final visibleCatalog assertion in “exposes wildcard allow and visible catalog behavior through one policy” allowedCatalog retains literal identity/metadata and wildcard permission checks. model-catalog-visibility.test.ts and registered models.list own publication. Synthesizing an undiscovered exact entry into a picker is retired.
doctor-config-flow.test.ts: “preserves %s provenance across repeated config writes” Config-writer marker tests remain in io.meta.test.ts and io.write-config.test.ts; older-writer proof retains its actual identity.
Doctor: “reports omitted primary for %s with %j without rewriting config”; “checks an agent primary against its inherited allow list” Default/agent/inherited diagnostic contracts remain meaningful. The three-case CLI refusal test alone does not replace them; final registered preview evidence remains due.
Doctor: “widens valid provider refs and preserves odd entries: $allow” Automatic helper acceptance is retired. Exact proposal content, unusual-entry preservation, explicit interactive acceptance, and repeat no-op remain required interactive proof.
Doctor: “offers only migration-marked restrictions when newer models exist: %j”; “keeps exact pins when no catalog row is hidden” Offer eligibility remains meaningful. CLI refusal covers the marked positive setup, not negative eligibility; retain that preview gap.
Doctor: “inspects mixed entries and per-agent policies without discarding odd values”; “reports dead refs and disabled providers without changing a hand-written list” Scope/preservation/guidance remain required; helper deletion does not establish those preview outcomes.
Doctor inline “offers upgrade-generated model allow lists with repair=$repair and status=$status”, dangling extra-row reset and removed offer-test fixture helpers Obsolete generic-repair widening and its test-only injection support are retired. Registered Doctor CLI and explicit interactive proof own consent. Deprecated-row offer-negative coverage remains due.
sessions-patch.test.ts: separate target-agent and global-subagent-primary allowance cases Consolidated into a parameterized case retaining both positives and adding main-session rejection.
get-reply-native-slash-fast-path.test.ts: local typing stub and repeated defaults Existing shared typing/parameter fixtures replace duplicated setup. Successful compaction explicitly supplies sessionCompaction.compacted; no behavior assertion is removed.
model-policy-notice.test.ts: in-memory successful receipt and stale pin/session write tests Formatter-only calls have no owned transcript and cannot prove publication. Matching/mismatching recorded-receipt rendering remains here; actual stale pin/session/writer behavior is exercised by registered Gateway authority tests.
agent-command.live-model-switch.test.ts: unused full-catalog tripwire and zero-prepared-read expectations The existing prepared snapshot must be read once through its actual owner. Exact config/read-only arguments and provider-scoped capability behavior replace the obsolete call-count contract; live-switch and fallback outcomes remain asserted.

Update and previous-state behavior

Update and noninteractive Doctor must preserve the allow list. Only a separate interactive choice can accept the displayed wildcard proposal. Generic authorized Doctor repairs may still update unrelated metadata or skills.

Retained installed-driver evidence used the actual 2026.9.3 updater against candidate b06415ce9ef6431cfb3b4fc00545324aca4e1f85: installed-upgrade.json records exit 0, completed canary/activation/verification, and a byte-identical allow list/config in that fixture. Its --no-restart run does not establish running-session continuity, every operator shape, or compatibility of the latest candidate. The six SDK helper/type cells at 9f07a237 establish only the narrow ownership/identity contract described above. Final published-driver, previous-state, and complete plugin-loading evidence remain due.

Remaining validation

The remaining proof limits above stay visible to the verdict lane. Under Ayaan’s updated sequence, this signed head is published now and remains frozen while the independent census verdict runs. Verdict corrections precede the final body and one exact-head local review. Current CI merge-tree census and structural receipts remain required for landing. Only the orchestrator supplies the merge grant; this publication does not merge the PR.

@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: telegram Channel integration: telegram app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 12, 2026, 9:01 AM ET / 13:01 UTC (Revision 13).

ClawSweeper review

What this changes

Aligns model pickers and execution with allowed effective defaults, preserves delivered recovery notices in shared history, and requires interactive consent before Doctor broadens generated allow lists.

Merge readiness

⛔ Blocked before merge - 7 items remain

Keep open: the recovery behavior remains absent from main, and the previous channel-default finding is addressed. No new blocking defect was established in the inspected paths, but the explicitly retained compatibility and integration acceptance gates remain unresolved.

Priority: P2
Reviewed head: 1989d38e6fe0ed19231710f734fe19fd771c173b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful owner-level repairs and substantial runtime evidence are present, but final compatibility and consumer coverage remain incomplete.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Retained real Telegram/Gateway observations exercise effective-default replies, shared notice history, restart persistence, and delivery recovery; registered final-effect cases cover revoked writer/lifecycle and changed-pin refusal. This evidence remains valid while final upgrade and native-rendering obligations stay separate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Retained real Telegram/Gateway observations exercise effective-default replies, shared notice history, restart persistence, and delivery recovery; registered final-effect cases cover revoked writer/lifecycle and changed-pin refusal. This evidence remains valid while final upgrade and native-rendering obligations stay separate.
Evidence reviewed 12 items Pinned source and clean checkout: The checkout is the original PR head 1989d38. The complete introduced file list was inspected locally against the host-pinned merge base; git status remained clean. The supplied test merge is stale and was not used to claim removal of main-branch behavior.
Captured discussion identity and outstanding gates: Fetched the complete PR body and verified SHA-256 fa5618e90152f2ac006a687049e66bcfc79a85db10c6930ad33098750b4f155a against the supplied snapshot. Its validation and remaining-validation sections explicitly retain final published-updater, previous-state, older-plugin/native, typed-reference, integration-tree, census ACCEPT, and orchestrator-grant gates. Omitted prompt ranges were not treated as absent proof.
Previous channel-default finding addressed: The shared channel projection now captures visibilityPolicy.effectiveDefault.ref, uses it for Default labels, and publishes it separately from authored resolvedDefault. Telegram, Discord, and Mattermost consume explicit null without restoring the authored default. The body reports the corrected three-case Gateway/CLI matrix passing.
Findings None None.
Security None None.

How this fits together

OpenClaw combines configured model preferences with provider catalogs to determine picker choices and execution defaults. Gateway, channel, and native clients consume those decisions, while session storage preserves model pins and delivered recovery explanations.

flowchart TD
  A[Model preferences and allow lists] --> C[Shared model selection policy]
  B[Prepared provider catalog] --> C
  C --> D[Gateway and client pickers]
  C --> E[Reply and compaction execution]
  E --> F[Delivered recovery explanation]
  F --> G[Guarded transcript and receipt]
  A --> H[Doctor consent and repair]
Loading

Decision needed

Question Recommendation
Does the frozen candidate satisfy the retained upgrade, older-plugin/native, and integration-census gates sufficiently to receive the orchestrator merge grant? Complete the retained acceptance gates: Keep landing blocked until final compatibility evidence and the independent census ACCEPT are recorded.

Why: The captured PR explicitly reserves acceptance to its named review and orchestration owners; retained earlier proof does not certify all final-candidate compatibility obligations.

Before merge

  • Resolve merge risk (P1) - Existing stored pins now execute through an allowed effective default; final published-updater and previous-state evidence must establish preserved preferences, credentials, and session continuity.
  • Resolve merge risk (P1) - The optional effectiveDefault SDK fact and changed assistant-persistence semantics have narrow compatibility evidence, but complete older-plugin loading and native-client validation remain explicitly outstanding.
  • Resolve merge risk (P1) - The independent caller census and final integration-tree acceptance are unfinished; this source review does not certify every consumer in the combined landing tree.
  • Complete next step (P2) - Complete or explicitly disposition the retained final-candidate upgrade, older-plugin/native, and caller-census gates, then record census ACCEPT and the orchestrator merge grant.
  • 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
Durable receipt 1 new session receipt field; no schema-version bump The modelPolicyNotice receipt changes restart-visible behavior and therefore needs previous-state compatibility proof despite reusing existing storage.

Stored data model

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

Mantis proof suggestion

Current browser chat controls and shared recovery-history rendering remain explicitly unverified in the captured checkpoint. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis verify web UI chat model choices and recovery history for a missing primary and a blocked stored pin, including reset and reconnect, and return redacted screenshots, transcripts, and relevant runtime diagnostics.

Merge-risk options

Maintainer options:

  1. Verify the final compatibility boundary (recommended)
    Complete published-driver, preserved-state, and supported plugin/native checks before accepting the changed selection and persistence contracts.
  2. Retain the freeze
    Pause landing while the designated owners reconcile the independent census and grant.

Technical review

Best possible solution:

Keep one shared selection and publication owner, preserve stored preferences, and certify the final candidate against published upgrades and supported plugin/native consumers.

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

Yes: configured missing primaries and excluded stored pins provide concrete reproduction paths supported by current source and retained before/after Gateway and Telegram observations; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes at the owner level: sharing selection facts and guarded transcript publication addresses the inconsistencies without another policy implementation, subject to the retained compatibility acceptance gates.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4e283f6de8b1.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Retained real Telegram/Gateway observations exercise effective-default replies, shared notice history, restart persistence, and delivery recovery; registered final-effect cases cover revoked writer/lifecycle and changed-pin refusal. This evidence remains valid while final upgrade and native-rendering obligations stay separate.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs model-selection and recovery inconsistencies without evidence of a product-wide emergency.
  • merge-risk: 🚨 compatibility: Stored-pin execution, SDK default semantics, and durable notice behavior change while final upgrade and supported-consumer evidence remains incomplete.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; 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 (live_output): Retained real Telegram/Gateway observations exercise effective-default replies, shared notice history, restart persistence, and delivery recovery; registered final-effect cases cover revoked writer/lifecycle and changed-pin refusal. This evidence remains valid while final upgrade and native-rendering obligations stay separate.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained real Telegram/Gateway observations exercise effective-default replies, shared notice history, restart persistence, and delivery recovery; registered final-effect cases cover revoked writer/lifecycle and changed-pin refusal. This evidence remains valid while final upgrade and native-rendering obligations stay separate.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The PR changes Telegram picker text, default selection, and visible recovery explanations; retained Telegram proof is relevant.

Evidence

What I checked:

  • Pinned source and clean checkout: The checkout is the original PR head 1989d38. The complete introduced file list was inspected locally against the host-pinned merge base; git status remained clean. The supplied test merge is stale and was not used to claim removal of main-branch behavior. (1989d38e6fe0)
  • Captured discussion identity and outstanding gates: Fetched the complete PR body and verified SHA-256 fa5618e90152f2ac006a687049e66bcfc79a85db10c6930ad33098750b4f155a against the supplied snapshot. Its validation and remaining-validation sections explicitly retain final published-updater, previous-state, older-plugin/native, typed-reference, integration-tree, census ACCEPT, and orchestrator-grant gates. Omitted prompt ranges were not treated as absent proof. (1989d38e6fe0)
  • Previous channel-default finding addressed: The shared channel projection now captures visibilityPolicy.effectiveDefault.ref, uses it for Default labels, and publishes it separately from authored resolvedDefault. Telegram, Discord, and Mattermost consume explicit null without restoring the authored default. The body reports the corrected three-case Gateway/CLI matrix passing. (src/auto-reply/reply/commands-models-catalog.ts:104, 1989d38e6fe0)
  • Still necessary on current main: Current main's policy composes configured selection and fallbacks but lacks this branch's snapshot-backed effective-default recovery. The central change is therefore not established as implemented on main. (src/agents/model-visibility-policy.ts:45, 4e283f6de8b1)
  • Latest release comparison: The supplied latest release, v2026.9.4, likewise lacks the effective-default recovery implementation in this owner. (src/agents/model-visibility-policy.ts:45, 3a9d69db306c)
  • Consent and compaction corrections retained: Doctor requires an interactive confirmation with initialValue false and excludes update-in-progress acceptance. Compaction excludes the missing primary's profile suffix while retaining valid explicit-primary credentials and refusing cross-runtime compaction of a blocked native binding. (src/commands/doctor-config-flow.ts:593, 1989d38e6fe0)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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.

  • Complete published-updater and previous-state compatibility evidence for the final candidate.
  • Finish supported native-client and older-plugin validation.
  • Reconcile the typed caller census with the accepted integration tree.

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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-11T11:10:00.645Z sha b02ee0f :: needs real behavior proof before merge. :: [P1] [P1] Preserve handwritten lists carrying the existing migration marker
  • reviewed 2026-09-11T12:16:25.670Z sha db08b18 :: needs real behavior proof before merge. :: [P1] [P1] Preserve handwritten lists carrying the existing migration marker
  • reviewed 2026-09-12T06:27:49.038Z sha b06415c :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T06:44:59.179Z sha e141992 :: needs real behavior proof before merge. :: [P1] [P1] Revalidate writer authority inside the physical-row commit
  • reviewed 2026-09-12T08:56:25.473Z sha 2f3df13 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T09:55:26.530Z sha 9f07a23 :: needs real behavior proof before merge. :: [P2] [P2] Drop the missing primary's auth pin during recovery compaction
  • reviewed 2026-09-12T10:54:54.336Z sha f321319 :: blocked before merge. :: none
  • reviewed 2026-09-12T11:25:50.217Z sha a635eac :: blocked before merge. :: [P2] [P2] Publish the effective default to channel pickers

@obviyus
obviyus force-pushed the feat/allow-list-one-view branch from d6079d1 to 3657191 Compare September 11, 2026 10:09
@obviyus
obviyus requested a review from a team as a code owner September 11, 2026 10:09
@openclaw-barnacle openclaw-barnacle Bot removed the app: macos App: macos label Sep 11, 2026
@obviyus
obviyus force-pushed the feat/allow-list-one-view branch 2 times, most recently from e141992 to 2f3df13 Compare September 12, 2026 08:36
@openclaw-barnacle openclaw-barnacle Bot added the channel: mattermost Channel integration: mattermost label Sep 12, 2026
@obviyus
obviyus force-pushed the feat/allow-list-one-view branch from 2f3df13 to 9f07a23 Compare September 12, 2026 09:41
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 12, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 12, 2026
@obviyus

obviyus commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this without merging. Verified on today's main through the real product: the web picker offers a fallback the allow list forbids and then rejects the click, and a removed primary is still offered as an enabled Default. The Doctor guidance problem did not reproduce (Doctor asks first and leaves the config unchanged). Two real defects do not need 254 files and +9.7k lines; a small fix at the shared permitted-catalog owner follows as its own PR. The branch stays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: ios App: ios app: web-ui App: web-ui channel: discord Channel integration: discord channel: mattermost Channel integration: mattermost channel: telegram Channel integration: telegram commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant