Skip to content

fix(models): require provider-bound credentials for provider use - #144768

Closed
obviyus wants to merge 47 commits into
mainfrom
feat/provider-use-admission
Closed

obviyus wants to merge 47 commits into
mainfrom
feat/provider-use-admission

Conversation

@obviyus

@obviyus obviyus commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Addresses #144726/#117956: provider entries, accessible accounts or plugin-owned env vars admit model use; generic credentials do not. Saving A retains working B; fallback records its replacement with one notice. Startup projects bindings; Doctor persists the same policy.

Head: 49a24d37509152ca12b95744b3ffc26d627602b6. Round5:101 tests and structural checks pass; census exits0; CI34704997470/1 pending. Production differs from ac6d: CI repair adds braces/renames a shadowed local; run-loop shares retry/proceed assignments; SQLite cell inspection shares row-read/missing-row handling. No API/schema/persistence change.

Consumers

F/S keys are defined once (F01=path, S01=symbol); later uses name that same file/symbol. F01:line adds position. Use/By tables map contracts to readers/writers.

Prefixes: runner/ = src/agents/embedded-agent-runner/; methods/ = src/gateway/server-methods/; doctor-shared/ = src/commands/doctor/shared/; plan/ = src/agents/runtime-plan/; cron-agent/ = src/cron/isolated-agent/; sessions/ = src/agents/sessions/; agents/ = src/agents/; gateway/ = src/gateway/; commands/ = src/commands/; sdk/ = src/plugin-sdk/; config/ = src/config/. reply/ = src/auto-reply/reply/; profiles/ = src/agents/auth-profiles/; system-agent/ = src/system-agent/; telegram/ = extensions/telegram/src/; test-project/ = test/tsconfig/tsconfig.core.test.; plugins/ = src/plugins/; infra/ = src/infra/; flows/ = src/flows/. Other paths are repository-relative. Braces list exact alternatives.

10,284 positions not individually mapped; typed+lexical census attached (11,692 syntax candidates minus1,408 mapped, not changed APIs).

Model/status readers

Wire: packages/gateway-protocol/src/schema/agents-models-skills.ts:ModelChoiceSchema/generated clients (available, unavailableReason, unavailableUntil, outcomes). Producers: F01=agents/model-catalog-decisions.ts, F38=methods/models-list-result.ts, F02=gateway/server-model-catalog.ts/chat metadata; typed IDs/booleans.

  • Browser transport: ui/src/lib/model-catalog-store.ts, ui/src/pages/model-providers/{load,catalog-discovery}.ts, ui/src/api/types.ts.
  • Browser choices/setup/counts after save/refresh: ui/src/pages/model-providers/{data,view-status,view,default-models-view}.ts; ui/src/lib/chat/model-select-state.ts; ui/src/lib/agents/display.ts; ui/src/pages/config/session-observer-settings.ts; ui/src/pages/new-session/{model-target,model-control}.ts.
  • Swift decode/state: apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift; OpenClawChatUI/{ChatGatewayPayloadCodec,ChatSessions,ChatViewModel+ModelControls}.swift. macOS apps/macos/Sources/OpenClaw/{QuickChatModelMenu,QuickChatModel}.swift disable unavailable choices and validate selections.
  • Android decode/control: apps/android/app/src/main/java/ai/openclaw/app/GatewayModelCatalog.kt and apps/android/app/src/main/java/ai/openclaw/app/ui/{ProvidersModelsScreen,chat/ChatModelPicker,chat/ChatScreen}.kt; generated bindings unchanged.
  • F03=commands/models/list.status-command.ts owns/reads missingProvidersInUse for aggregation/JSON/exit/recovery; no native/browser consumer. F39=methods/models-auth-status.ts reads stored health; native/browser health interaction is unproved.
  • Chat: reply/commands-status.ts → src/status/status-text.ts:buildStatusReplyParts → F04=src/status/status-model-auth.ts. Prepared profile label/env name/runtime mode only; no values/private IDs; personal IDs render personal account.

Picker/cache/accounts

  • models-auth-status.ts publishes inventory/usage separately from servingAuth; shared/UI types retain both. loadModelAuthStatus groups aliases/profiles and coalesces client/agent reads; panes pass inventory/accountSelection.
  • chat-model-controls.ts derives auth/setup labels; chat-model-picker.ts renders once. chat-account-selection.ts stores preference, not receipts. chat-model-account-control.ts users.listModelAccounts on open/retry; close keeps options, client/session/model changes replace. Connection/epoch/request/agent fences/headings retained.
  • Serving excludes pinned/non-main selections; CLI-only. API/API stays API, multiple subscriptions omit email. A inventory may coexist with B serving.
  • model-catalog-cache.ts/model-catalog-store.ts cache/coalesce per client, expire at cooldown, publish current successes. Refresh/app-host.ts/chat metadata/new-session retirement invalidate; pages subscribe to config/chat. Passive reads cannot retire discovery.
  • Retry owns generation/controller/connection epoch. supplemental-load.ts:adoptCoreData preserves newer model/default-utility/outcome/pending/error state; core-load.ts awaits core/Retry then invalidates display. Picker open does not acquire.
  • includeDefaultModels/defaultModels.automaticUtilityModel/refreshFailed/pendingProviders stay unchanged; model/chat/new-session/command-models and optional Swift decoders consume them.

Admission/family conflicts

  • Owner: F05=agents/provider-model-auth-source-plan.ts.
Use By
S01=resolveProviderUseAdmission agents/{agent-auth-discovery-core,prepared-model-catalog.worker,prepared-model-runtime.facts}.ts; F40=sessions/model-registry.ts; F06=agents/provider-auth-recovery-hint.ts
ProviderUseBinding, S01 agents/{agent-auth-discovery,models-config.providers.catalog-context}.ts
S01, S02=resolveProviderEnvironmentAdmission F07=agents/model-auth-availability.ts, F41=plan/prepare-auth.ts
ProviderUseBinding agents/models-config.providers.{implicit,secrets}.ts; F42=plan/auth-source-preference.ts
ProviderUseBinding, S01, S02, S28=isGenericProviderCredentialEnvVar, S29=resolveProviderUseBindingCredentialPolicy, S30=providerUseBindingConflictsWithAccount F05
S02 F08=commands/doctor-config-analysis.ts
S01, S28, S29, S30 F09=config/provider-use-binding-plan.ts

Manifest env owners

  • Owner: F10=src/secrets/provider-env-vars.ts; bundled manifest setup.providers[].envVars and providers.
Use By
S31=resolveProviderBindingEnvVarCandidates agents/{agent-auth-discovery-core,agent-auth-discovery,model-auth-availability,models-config.providers.catalog-context,prepared-model-catalog.worker,prepared-model-runtime.facts}.ts; F40; F06; F41; F08
ProviderBindingEnvVarCandidates F05
ProviderBindingEnvVarCandidates, S31 F09, F10

Admitted discovery

  • Owner: agents/{agent-auth-discovery-core,prepared-model-runtime.configured}.ts.
Use By
addEnvBackedAgentCredentials agents/agent-auth-{discovery-core,discovery}.ts
collectPreparedModelRuntimeProviderIds agents/prepared-model-runtime.{configured,facts}.ts

Catalog scope/SDK donors

  • Owner: F11=agents/models-config.providers.catalog-context.ts; F12=sdk/provider-catalog-live-runtime.ts.
Use By
S32=buildOpenAICompatibleProviderFamilyCatalog extensions/byteplus/index.ts, extensions/volcengine/index.ts
augmentModelCatalogWithProviderPlugins agents/model-catalog.ts; sdk/provider-catalog-runtime.ts; plugins/provider-{runtime.runtime,runtime}.ts
S33=resolveCatalogProviderUseAdmission, runProviderCatalogForAdmittedDestinations, runProviderCatalogWithTimeout, prepareProviderCatalogRun, S34=reportProviderCatalogSecretFailure F11
S33, runProviderCatalogWithTimeout agents/models-config.providers.implicit.ts
S32, credentialProviderId F12

Bedrock discovery

  • Owner: extensions/amazon-bedrock/discovery.ts.
Use By
resolveImplicitBedrockProvider extensions/amazon-bedrock/{api,discovery,register.sync.runtime}.ts

Credential source/env name

  • Owner: F41, auth.ts and types.ts.
Use By
credentialSource runner/run/{attempt-normalization,attempt-recovery,backend,helpers,terminal-preparation}.ts; runner/types.ts
boundEnvVar runner/run/{auth-controller,runtime-preparation}.ts; agents/{model-auth-availability,model-auth-model,model-auth-provider-config,model-auth-provider,provider-model-auth-source-plan,provider-model-route-auth}.ts; plan/{auth-source-preference,resolve-auth}.ts
boundEnvVar, credentialSource, retainAutomaticAuthSource F13=runner/run/auth-profile-success.ts; plan/{prepare-auth,types}.ts; F14=agents/simple-completion-runtime.ts
boundEnvVar, credentialSource plan/auth.ts

Readiness/source/hints

  • Owner: F07; F42; F06.
Use By
S03=buildProviderAuthRecoveryHint runner/run/{auth-controller,incomplete-turn-resolution}.ts; F06; reply/agent-runner-failure-reply.ts; F43=commands/doctor-auth.ts
S04=createModelAuthAvailabilityResolver agents/model-{auth-availability,catalog-decisions,provider-auth}.ts; doctor-shared/retired-model-ref-repair.ts; infra/update-repair-inference.ts
resolveProviderSourceConfig F15=agents/model-auth-provider-config.ts
S04, hasUsableEnvironmentAuth F16=agents/model-fallback-cooldown.ts
hasUsableEnvironmentAuth agents/model-fallback-runner.ts
S35=resolveAutomaticDirectAuthFallback, S36=resolveAutomaticAuthSourcePreference, S37=createUnavailableAutomaticAuthError, S38=resolvePreparedAuthProfileSource, S03 F42
S35, S36, S37, S38 F41
S04, S03 commands/auth-choice.model-check.ts, F03

Provider selection

  • Owner: agents/{configured-provider-selection-ids,model-selection-config}.ts; F44=config/model-input.ts.
Use By
S39=resolveSelectedModelFallbacksOverride agents/agent-scope.ts, F44
ConfiguredProviderUseSelection, S40=collectConfiguredProviderUseSelections, S41=collectConfiguredProviderSelectionIds, S42=collectConfiguredModelProviderSelectionIds, S43=collectConfiguredMediaProviderSelectionIds, collectSelectedModelProviders F17=agents/configured-provider-selection-ids.ts
S44=resolveSelectedModelProviderIds agents/{model-auth-availability,models-config.providers.catalog-context,prepared-model-catalog.worker,prepared-model-runtime.facts}.ts
collectSelectedModelProviders, S44, S39 F18=agents/model-selection-config.ts
S42, S43 doctor-shared/configured-provider-plugin-ids.ts
S41 doctor-shared/{configured-provider-plugin-installs,stale-agent-model-ref-repair,startup-plugin-convergence-plan}.ts
ConfiguredProviderUseSelection, S40 F09

Startup binding/receipts

  • Owner: F09; F19=doctor-shared/provider-use-binding-migration.ts.
Use By
S05=prepareProviderUseBindingMigration, S45=resolveProviderUseBindingWriteMetadata F45=commands/doctor-config-flow.ts
PROVIDER_USE_BINDING_MIGRATION, PROVIDER_USE_BINDING_SELECTION_VERSION, S06=ProviderUseBindingMigrationBindings, S05, S45, revalidateProviderUseBindingMigration, S46=writeProviderUseBindingMigration, S47=completeProviderUseBindingMigration, providerUseBindings, S07=providerUseBindingMigrationPending, selectionVersion F19
providerUseBindings config/{io.snapshot-shared,resolution-facts}.ts
PROVIDER_USE_BINDING_MIGRATION, PROVIDER_USE_BINDING_SELECTION_VERSION, S06, S05, S48=applyProviderUseBindingsToRuntime, selectionVersion F09
S48 config/validation.ts
S46, S47, providerUseBindings, S07 F20=flows/doctor-health-contribution-runners.config.ts
S06, providerUseBindings, S07 F21=flows/doctor-health-contribution-types.ts

Binding facts/copies

  • Owner: config/{resolution-facts,io.snapshot-shared}.ts.
Use By
S08=getConfigProviderUseBindings agents/{model-auth-availability,model-auth-provider,prepared-model-runtime-auth}.ts; F41
S09=resolveConfigProviderUseBindings agents/{model-auth-provider-config,provider-model-auth-source-plan}.ts
S10=copyConfigResolutionFacts agents/models-config.plan.ts; config/{io.context,materialize,validation}.ts; F46=cron-agent/run-config.ts; gateway/server-{reload-managed,startup-config}.ts; src/security/audit.ts; system-agent/inference-route.ts
S08, S10 F11
S08, S11=setConfigProviderUseBindings F47=agents/models-config.ts, config/io.snapshot-shared.ts
S12=serializeConfigResolutionFacts agents/prepared-model-catalog-worker.ts
S10, restoreConfigResolutionFacts F22=agents/prepared-model-catalog.worker.ts
ConfigProviderUseBindings F42
S13=cloneConfigWithResolutionFacts reply/reply-tool-authority.ts; gateway/credentials-secret-inputs.ts; src/secrets/runtime-{command-secrets,fast-path,state}.ts; system-agent/verified-inference.ts
S14=copyConfigResolutionFactsExcept, S13 src/cli/command-secret-gateway.ts, src/secrets/runtime.ts
S10, S14 commands/models/list.probe.ts, gateway/server-startup-config-helpers.ts
S11, S09 F09
ConfigProviderUseBindings, S08, S11, S09, S49=retainConfigProviderUseBindings, S10, S14, S13, S12, restoreConfigResolutionFacts F48=config/resolution-facts.ts
S10, S12 config/runtime-snapshot.ts
S14 gateway/{auth-resolve,secret-input-paths,startup-auth}.ts; src/node-host/runner.ts
S08, S11, S49, S10, S14 gateway/server-startup-bootstrap.ts

Provider declarations/writes

  • Owner: config/{config-path-mutation,io.write,mutate}.ts.
Use By
S15=resolveManagedUnsetPathsForWrite, explicitSetPaths, unsetPaths src/cli/config-cli-runner.ts, config/io.runtime.ts
explicitSetPaths src/cli/connect-cli.ts; F45; commands/models/shared.ts; commands/setup.ts; config/io.{auth-inheritance-owner,session-store-owner}.ts; flows/doctor-health-contributions.ts; plugins/management-mutations.ts
S16=applyUnsetPathsForWrite, S15 (planner); unused withCommit/unsetPaths forwarding removed F23=doctor-shared/automatic-startup-config-repair.ts
withCommit, explicitSetPaths, unsetPaths, S17=GuardedConfigIncludeWriteError F19
S16, S15, unsetPaths config/config-path-mutation.ts
S15, unsetPaths F49=config/io.snapshot.ts
withCommit, explicitSetPaths, unsetPaths config/io.types.ts, F20
explicitSetPaths, unsetPaths config/io.write-{prepare,topology}.ts; F21
S16, S15, withCommit, explicitSetPaths, unsetPaths config/io.write.ts
S16, S15, withCommit, explicitSetPaths, unsetPaths, S17 config/mutate.ts
S17 config/mutation-conflict.ts
unsetPaths F09, plugins/install-record-commit.ts, plugins/runtime/types-core.ts

Account publication/stores

  • Owner: F50=profiles/publication.ts, sqlite.ts, candidate-stores.ts and candidate-store-update.ts; F51=infra/file-lock-sync.ts.
Use By
S50=updateCandidateAuthProfileStore profiles/candidate-store-update.ts
S51=listCandidateAuthProfileStores, loadCandidateAuthProfileStore profiles/candidate-stores.ts, commands/models/auth-api-key.ts, F09
S51, loadCandidateAuthProfileStore, S50 profiles/oauth-refresh-peers.ts
isSetupCredentialAccessible profiles/{oauth,order}.ts; agents/cli-runner/prepare.ts; F05
S52=withAuthProfilePublicationLock, S53=withAuthProfileStorePublication, acquireFileLockSyncWithRetry F50
isSetupCredentialAccessActive, isSetupCredentialAccessible profiles/setup-access.ts
S53, S18=writePersistedAuthProfileStoreRaw, S19=deletePersistedAuthProfileStoreRaw profiles/sqlite.ts
S18, S19 profiles/store.ts
S19 profiles/upsert-with-lock.ts
isSetupCredentialAccessActive F07, F42, F14
acquireFileLockSyncWithRetry sessions/settings-storage.ts, commands/doctor-auth-migration-receipts.ts, F51
S18 commands/doctor-auth-flat-profiles.ts
S52 F19

Session database readers

  • Owner: F24=config/sessions/targets-existing.ts.
Use By
ExistingAgentDatabaseTarget, S20=resolveTargetSqlitePath, S54=projectExistingAgentDatabaseTargets commands/doctor-session-canonical-candidates.ts
S21=listExistingAgentDatabaseTargets commands/doctor-session-delivery-state.ts, F09
S22=resolveTargetSqliteOptions, S21 commands/doctor-session-incognito-key-repair.ts
S22 commands/doctor-session-{sqlite-compact,transcript-headers,transcript-labels}.ts
S20 commands/doctor-session-{sqlite-readers,sqlite-restore-report,sqlite}.ts
S22, S20 commands/doctor-session-sqlite-recover-report.ts
ExistingAgentDatabaseTarget, S22, S20, S54, S21 F24

Cron path readers

  • Owner: F52=src/cron/store/path.ts (existing src/cron/store.ts public exports retained).
Use By
S55=resolveCronJobsStorePathFromConfig F17; src/cli/claws-cli.monitor-cleanup.ts; commands/doctor-{heartbeat-cadence-migration,heartbeat-scratch-migration,heartbeat-task-migration,skill-workshop-automations}.ts; config/io.write.ts; gateway/server-{cron-lazy,cron}.ts; infra/heartbeat-{dispatch,runner-prompt}.ts
resolveCronJobsStorePath reply/agent-runner-reminder-guard.ts; src/cli/claws-cli.runtime.ts; commands/doctor/cron/{index,legacy-repair}.ts; commands/tasks-session-registry-maintenance.ts; src/cron/local-service.ts; src/logging/diagnostic-session-context.ts
resolveCronJobsStorePath, S55 src/cron/store.ts reexports F52; third stateEnv selects persisted state while env expands paths. Workshop passes both.

Doctor/startup

  • Owner: F08; F53=commands/doctor/emit-notes.ts; F25=commands/doctor-config-preflight-startup.ts; F20.
Use By
S56=collectInvalidHookTransformsDirWarnings, S57=noteProviderEnvOwnershipConflicts F08
S56, S57, createDoctorChangesPanelSink F45
commitStartupConfigRepairs commands/doctor-config-{preflight-startup,preflight}.ts
createDoctorChangesPanelSink F53
collectSecretRefProviderSourceIssues config/{validation-secretrefs,validation}.ts
configWriteRefusal flows/doctor-{health-contribution-runners.config,health-contribution-types,health-contributions,health}.ts

Health/CLI status

  • Owner: F54=agents/auth-health.ts; commands/models/list.{auth-overview,status-command}.ts.
Use By
buildAuthHealthSummary F54, F43, F39
resolveProviderAuthOverview F26=commands/models/list.auth-overview.ts
buildAuthHealthSummary, resolveProviderAuthOverview, missingProvidersInUse, runtimeCredentialsByProvider F03

Gateway serving status

  • methods/models-auth-status.types.ts adds optional servingAuth (agent ID/directory, ModelServingAuth rows); existing health/capability/request/config/storage schemas remain.
  • models-auth-status.ts → models-auth-status-serving.ts:buildModelAuthServingSnapshot → createModelCatalogDecisions carries source/store/modes/materializations/metadata/registry/observation config/currency. Output: availability/retry/requirement/profile/mode/evidence/env name/runtime identity/availability/incompatibility; secrets/headers/routes stay private.
  • F18:collectSelectedModelProviders splits selector/alias auth pins; status excludes auxiliary/same-model pins, admission keeps provider/path/mainModel.
  • model-catalog-decisions.ts shares selectCatalogDecisionRuntime for runtime/status; agents/harness/runtime-plugin.ts shares missing-registration diagnostics without activation/discovery.
  • agents/cli-backends.ts:listCliRuntimeModelBackendBindings accepts serving registry. Default readers: listCliRuntimeProviderIds/resolveCliRuntimeCanonicalProvider/resolveCliRuntimeModelBackendBinding/runtimeChoices, model-runtime-aliases.ts:isCliRuntimeAlias, auto-reply/reply/commands-models.ts and both gateway/gateway-cli-backend.live-helpers.ts readers. Overflow harness forwards params; owner-only test covers isolation.
  • commands/models/auth-refresh.ts:readRunningGatewayModelAuthStatus serves list.status-command.ts only for local shared auth/read-only state/matching agent+directory. Rows feed summaries/routes/missing-provider/issues. Missing/old rows/pre-connect failure/mismatch/--probe use local handling; post-onHelloOk disconnect/timeout/preparation/publication errors remain errors.
  • list.auth-overview.ts shows unnamed env as Gateway runtime auth; named variables/health stay separate. docs/cli/models.md documents it; UI/native ignores servingAuth.

Auth invalidation/retention

  • Owner: agents/prepared-model-{runtime-auth,runtime-auth-publication,runtime.owner}.ts.
Use By
S23=copyPreparedModelRuntimeAuthBindings runner/compact.ts, F27=agents/prepared-model-catalog.ts
S23 preserves the same private state on the ordinary-run project-context projection runner/run-orchestrator.ts
S24=getPreparedModelRuntimePreferredAuthSource, preferredAuthSource runner/compaction-runtime-preparation.ts, agents/harness/compaction.ts, agents/prepared-model-catalog-owner.ts, F28=methods/chat-metadata-session-projection.ts, F04
S24 runner/run/auth-plan.ts, agents/isolated-completion.auth.ts
S25=recordPreparedModelRuntimeAuthSource F13
preferredAuthSource agents/{model-auth-availability,model-catalog-decisions,prepared-model-catalog.types}.ts; F38; gateway/server-model-{catalog-auth,catalog}.ts
preferredAuthSource, createModelCatalogDecisions, resolveCatalogDecisionRuntimeStatus F29=methods/models-auth-status-serving.ts
S58=retainModelRuntimeAuthSourcesAfterMutation, S59=invalidatePreparedModelRuntimeOwnersForAuthMutation agents/prepared-model-runtime-auth-publication.ts
S60=prepareModelRuntimeAuthSources, S58, bindModelRuntimeAuthSources, S24, S25, S23 agents/prepared-model-runtime-auth.ts
S60, bindModelRuntimeAuthSources, S23 agents/prepared-model-runtime.owner.ts
S59 F30=agents/prepared-model-runtime.ts
S24, S25 F14

Auth completion/accounts

  • gateway/config-reload.ts:reconcileExternalWrite uses the snapshot/watcher queue and receipt, rereads bytes, and preserves runtime overlays for already-applied bytes through acceptCurrentRuntimeEcho. In-process source tags remain.
  • gateway/ handle chain: server-runtime-handles.ts → createGatewayServerMutableState/minimal unclaimed handle → server-reload-managed.ts/server-reload-contracts.ts → server-startup-finish.ts/server-lifecycle.ts installation.
  • methods/shared-types.ts:reconcileConfigAfterExternalWrite → server-request-context.ts current handle, stopped on close; local-request-context.ts returns unclaimed. Unused close-only test contexts need no member.
  • commands/models/auth.ts/auth-api-key.ts → plugins/provider-auth-helpers.ts:applyAuthProfileConfig declares A, not stored B. profiles/order.ts accepts retainedProfile only from agents/model-auth-availability.ts/plan/prepare-auth.ts. Without explicit order it retains eligible working family B after exact-provider A is saved. Explicit-empty-order, expiry/removal/cooldown/binding/pin and auxiliary contracts remain.

Chat status/setup

  • createStatusModelAuthResolver reads selectedProfileId/selectedAuthMode/environmentVariable/runtimeAuth.id from decisions; stale owner is unknown, user/user-link pins strict.
  • commands-models.ts:resolveModelAuthLabel is inventory; status-usage.runtime.ts remains auxiliary.
  • prepareAgentRuntimeAuth/createModelAuthAvailabilityResolver exclude env direct-use binding during setup access; expired replacement cannot borrow it.

Private lookup/test partitions

resolveProviderSourceConfig is private in F15;2 local callers, SDK behavior unchanged. F31=scripts/lib/tsgo-core-test-shards.mts registers agents-auth:90 roots moved from agents-root/agents-other, unchanged bodies/720-root ceiling.

Completion/notice

  • Owner: F13; F14; F32=src/llm/model-runtime-binding.ts.
Use By
PreparedEmbeddedRunAuthSource, reportEmbeddedRunSuccessfulAuthBinding, appendEmbeddedRunAuthSourceNotice runner/run/{auth-profile-success,terminal-resolution}.ts
prepareIsolatedHarnessAuth agents/isolated-{completion.auth,completion}.ts; await quota reconciliation, then assertCurrent and read preferred source.
getModelCompletionSuccess agents/simple-completion-execution.ts
bindModelCompletionSuccess F14; prepareSimpleCompletionModel carries optional assertCurrent/signal across quota reconciliation; success/notice binding remains.
bindModelCompletionSuccess, getModelCompletionSuccess F32

Session model projection

  • Owner: F28; F01; F38.
Use By
S26=requestedProviderIds agents/{model-auth-availability,models-config.plan,models-config.providers.catalog-context,models-config.providers.implicit,models-config,prepared-model-runtime.scoped-catalog}.ts
S26, selectedModel F01
S27=resolveSessionCatalogProfiles (consumes the returned profile/selected-model projection) methods/chat-metadata-runtime.ts
S27, selectedModel F28
S27, S26, selectedModel F38

Documentation readers

  • docs/auth-credential-semantics.md
  • docs/concepts/model-providers.md
  • docs/concepts/model-providers/{custom-providers,official-provider-plugins}.md
  • docs/gateway/config-tools/provider-examples.md
  • docs/gateway/configuration-examples.md
  • docs/gateway/doctor/config-migrations.md
  • docs/help/environment.md
  • docs/install/kubernetes.md
  • docs/providers/{anthropic,arcee,bedrock-mantle,bedrock,google,minimax,models,moonshot,ollama-cloud,opencode-go,opencode,openrouter,stepfun,volcengine}.md
  • docs/providers/ollama/{configuration,model-discovery,recipes,setup}.md
  • docs/start/wizard-cli-reference.md

Cron config facts

F46:resolveCronAgentConfig now copies private facts at :77 with copyConfigResolutionFacts(runtimeConfig,cfgWithAgentDefaults). This repairs the top-level spread that lost startup-approved bindings for persisted cron selectors; no new admission policy.

Moved target tests

Consumer Disposition
commands/doctor-agent-database-admission.test.ts listExistingAgentDatabaseTargets import moves from ./doctor-session-sqlite-readers.js to ../config/sessions/targets-existing.js; admission assertion retained,091passed.
commands/doctor-session-sqlite.discovery.test.ts and calls :60, :163, :326, :463 resolveTargetSqlitePath imports ../config/sessions/targets-existing.js instead of the retired owner; dry-run/validation/recovery assertions retained,091passed.

Production readers

Consumer Disposition
runner/compaction-runtime-context.ts; plan/credential-scoped-model.ts Moved agentRuntimeAuthPlanMatchesTarget import; only a matching provider/model plan supplies harness/compaction/materialization auth.
F33=agents/prepared-model-runtime.catalog-access.ts Moved templateModelRegistry/fingerprintPreparedRuntimeFacts imports; reprojects retained discovery and native publication identity.
agents/prepared-model-runtime.catalog-contract.ts Carries admitted IDs, template registry and captured models JSON.
agents/models-config.providers.discovery-auth.runtime.ts; plugins/provider-discovery.ts Moved isActive callback stops retired OAuth preparation and late hook outcomes respectively; required in the first consumer, optional in the second.
cron-agent/run.ts Forwards copied cfgWithAgentDefaults from run-prepare to execution/finalization.
cron-agent/run-executor.ts:402–959; cron-agent/run-finalize.ts:131–502 Same config carries policy/auth/execution, then context accounting/delivery; no new admission owner.
cron-agent/delivery-{dispatch-types,dispatch}.ts:236–582 Derived config transport; channel transforms/announcement/speech/delivery stay auxiliary.
cron-agent/current-session-completion.ts Derived config supplies local-media/current-session delivery, not credential permission.

Test/fixture readers

Retained supplemental consumers; no added live proof.

Consumer Contract
plan/prepare-auth.test.ts Moved target match, same provider/model scope.
agents/prepared-model-runtime.configured-catalog.test.ts Real batch owner,6 compositions.
profiles/candidate-stores.test.ts Moved candidate writer.
commands/doctor-session-sqlite.{memory.test-support,test}.ts Canonical paths: read-only transcript memory; legacy/current maintenance.
extensions/anthropic-vertex/runtime-catalog.test.ts Real registry/captured JSON, plugin catalogs off.
agents/agent-model-discovery.{test,endpoint.test,membership.test}.ts Captured/malformed root+toggle; null root/endpoint; deferred membership.
agents/models-config.applies-config-env-vars.test.ts Real keyless-plan registry, plugin catalogs off.
agents/models-config.{model-input-presence.test,root-authorship.test,write-serialization.test}.ts JSON normalized costs; authored-root preservation; unchanged serialization.
agents/prepared-model-runtime.{owner-selection.test,startup-static.test,test-harness}.ts Captured ownership; deferred discovery; typed null-JSON/empty-plugin fixture.
sessions/model-registry.{sources.test,test}.ts Real source combinations/authored-generated isolation.
agents/tools/media-generate-tool.{donor-resources.test,resources.test}.ts Template registry donor/tool lifetime, auxiliary.
src/cron/isolated-agent.direct-delivery-core-channels.test.ts; cron-agent/run.{model-policy-config-preserved.test,sandbox-config-preserved.test}.ts Derived config propagation; no authored-model acquisition; sandbox unchanged.
src/cli/cron-cli/cron-suppression.gateway.test.ts; cron-agent/{current-session-completion.test,delivery-dispatch.double-announce.test}.ts Config reaches suppression/delivery/speech; no private-auth read.
cron-agent/run.{message-tool-policy.test,source-delivery-guard.test}.ts Executor tool/delivery guards.
src/cron/service.manual-delivery.test.ts; gateway/session-message-events.test.ts Real dispatch/config; no credential-fact read.
ui/src/e2e/quota-reset-status.real-gateway.e2e.test.ts Typed status/health/usage refresh+ready-profile fixture.

Exports/hosts/terminals

Registry carriers preserve instance/admission; fixtures are supplemental.

Consumer Disposition
agents/btw.ts Side-question/fallback awaits quota, then canonical model/store/session auth.
sdk/agent-harness-runtime.ts Typed prepareAgentRuntimeAuth export; retained external matrix.
sdk/agent-sessions.ts Private-JS ModelRegistry, maintained declaration exception; create/options/fork/refresh matrix.
sessions/{index,extension-sdk}.ts Same registry re-exports, retained alias scope.
sessions/sdk.ts Factory creates/refreshes on resource reload; omitted admission owner-derived.
sessions/model-resolver.ts Pattern/default/restore uses inventory/getAvailable/find/hasConfiguredAuth.
sessions/extensions/{types,runner}.ts Extension registry model/key API and runner.
sessions/agent-session-{types,base}.ts Registry config/storage/access.
agents/harness/types.ts; runner/run/types.ts Typed registry/admission carriers.
runner/model.ts; src/worker/embedded-agent.runtime.ts In-memory/supplied resolution; native empty registry uses host model without persisted catalog.
agents/prepared-model-runtime.configured-completion.ts Captured callback completes configured misses; no global recovery.
F33 Fingerprint/registry/acquisition intersects worker admission.
runner/compact.hooks.harness.ts Typed compaction fixture, not public registration.
agents/simple-completion-runtime.test-support.ts; runner/model.generation-scope.test-support.ts In-memory completion/generation fixtures; no persisted fallback.
agents/code-mode-description-retention.test-support.ts; sessions/agent-session-loop-correctness.test-support.ts Empty prompt/loop fixtures; no provider-file/admission proof.
reply/{get-reply.types,commands-login}.ts Host config/refresh for login; missing callback rejects, no global fallback.
methods/chat-send-agent-dispatch.ts Connected-admin authority checked across await.
gateway/server-plugins.ts Same-Gateway reply callbacks; replacement rejects. Generic request rejects stale output, preserves committed effects.
sdk/provider-auth-login-flow-runtime.ts Required host refresh/config-authority fences. SDK082 callback only; absent9.4 functions candidate-only.
telegram/bot-native-command-login.ts Awaits registered refresh under account/command authority; Telegram075 is CLI-save proof.
extensions/google-meet/src/plugin-registration.ts Request/timeout/admin forwarding; stale error, unchanged standalone CLI.
extensions/workboard/src/automation-nudge.ts cron.run ran/reason/runId logs; stale warning, accepted work not cancelled.
extensions/workboard/src/lifecycle-sync.ts agents.list selectionRequired/sessions.list rows+completeness; stale failure is incomplete.
src/meeting-bot/browser-request.ts In-process method/path/body/timeout stale rejection; CLI unchanged.
src/meeting-bot/voice-call-gateway.ts callId/status/speak rejection/skipped-intro log; remote route/committed effects unchanged.
src/meeting-bot/plugin-entry.ts; plugins/runtime/index.ts Generic result/error and bound/standalone adapters; separate authorities.
commands/models/list.list-command.ts Owns prepare/project/release; availability/identity/name/input/context/local/tags, no reason/until/runtime/account; outcomes warn.
src/tui/embedded-backend.ts Materializations/preferred source → rows; ignores response fields, releases owner.
src/tui/gateway-chat.ts Complete capable-Gateway rows; old route strips unreliable availability/reason, ignores response fields.
src/tui/tui-command-handlers.ts provider/id picker blocks unavailable/reason; reopen reloads, no expiry timer; request/session render fence.
F55=system-agent/tui-backend.ts Independent empty list, outside flow.

Lexical/private dispositions

29 lexical categories: source dispositions, not typed closure or blanket exemptions. Raw SHA256:c1b4e7836c7de4670dbad3f1fa7138c9998e0f5f33c53e7df0f608ccd07ce629.

Name Reviewed boundary
credentials Provider-ID collector now takes admitted IDs; facts.credentials still feeds grouping. Other store/connector/UI fields are separate.
defaults; refValue Moved validation-secretrefs.ts call preserves config.secrets.defaults/target.refValue and resolver/schema; Cron derived config is separate.
drain; emit Private Doctor sink moved to F53; doctor-config-flow.ts calls remain. Other stream/socket/queue/event declarations are separate.
isActive Catalog lifetime reaches discovery-auth.runtime.ts/provider-discovery.ts and rejects retired work; unrelated activity fields are separate.
status ProviderCatalogOutcome.status/AgentHarnessRuntimeAvailability.status remain typed through public/serving CLI; HTTP/process/job/UI fields separate.
includeChannelModelOverrides Unchanged packages/model-catalog-core/src/configured-model-refs.ts option; relocated collector still passes false, plugin-auto-enable.shared.ts/telemetry.ts retain callers.
prepareCapturedRuntimeFacts Private configured-catalog batch consumer only.
prepareProviderCatalogRun; S34 Private timeout-owner consumers in models-config.providers.catalog-context.ts; no reexports.
refreshCommittedProviderCatalogs Deleted; class-owned refreshCommittedCatalogs supplies the listed publication consumers.

First8 counts exclude imports/repeated reads: credentials facts.ts:143,283; defaults/refValue validation-secretrefs.ts:18; drain doctor-config-flow.ts:699; emit :211,348,582,628; isActive catalog-context.ts:241,355; status catalog-context.ts:281,305,393 and harness/runtime-plugin.ts:161; includeChannelModelOverrides configured-provider-selection-ids.ts:51, plugin-auto-enable.shared.ts:112,392,508, telemetry.ts:238. Typed readers remain in scope.

Remaining17 counts include owner/test files, not dynamic calls; private none means no outer/exported consumer.

census: generic credentials reviewed — 2 callers listed
census: generic defaults reviewed — 1 callers listed
census: generic drain reviewed — 1 callers listed
census: generic emit reviewed — 4 callers listed
census: generic isActive reviewed — 2 callers listed
census: generic refValue reviewed — 1 callers listed
census: generic status reviewed — 4 callers listed
census: generic includeChannelModelOverrides reviewed — 5 callers listed
census: generic agentRuntimeAuthPlanMatchesTarget reviewed — 5 callers listed
census: generic captureModelsJsonContents reviewed — 2 callers listed
census: generic cfgWithAgentDefaults reviewed — 19 callers listed
census: generic collectConfiguredMediaProviderSelectionIds reviewed — 2 callers listed
census: generic collectConfiguredModelProviderSelectionIds reviewed — 2 callers listed
census: generic collectConfiguredProviderSelectionIds reviewed — 4 callers listed
census: generic ExistingAgentDatabaseTarget reviewed — 2 callers listed
census: generic fingerprintPreparedRuntimeFacts reviewed — 5 callers listed
census: generic includePluginCatalogs reviewed — 9 callers listed
census: generic listExistingAgentDatabaseTargets reviewed — 5 callers listed
census: generic modelsJsonContents reviewed — 21 callers listed
census: generic prepareConfiguredRuntimeFactsBatch reviewed — 4 callers listed
census: generic projectExistingAgentDatabaseTargets reviewed — 2 callers listed
census: generic resolveTargetSqliteOptions reviewed — 6 callers listed
census: generic resolveTargetSqlitePath reviewed — 8 callers listed
census: generic templateModelRegistry reviewed — 8 callers listed
census: generic updateCandidateAuthProfileStore reviewed — 3 callers listed

Publication/outcomes

  • prepared-model-runtime.full-catalog.ts/.catalog-access.ts own entries/routeVariants/staticEntries/nativeRuntime/providerOutcomes/runtimeModels with separate inventory/transport/readiness. Registered retained proof preserves4096 tokens at the request; sources.test.ts covers captured batch/fingerprint/registry.
  • F56=gateway/model-auth-refresh.ts succeeds only for applied; restart-pending requires completion, all failed/superseded/incomplete/applied-restart-required outcomes reject. CLI reads serving facts; native/UI inventory ignores them.
  • Plugin generations retain binding facts through terminal auth reporting. ConfigFileSnapshot.hash covers root/includes; hashConfigRaw(snapshot.raw) and updater failureFacts keep root-byte authority. Valid read-only refusal warns without closing receipts; invalid config/other failures remain errors.

Startup writer cleanup

F23:commitAutomaticConfigRepair drops unused unsetPaths/withCommit; sole caller F25 passed neither. Planner keeps applyUnsetPathsForWrite/resolveManagedUnsetPathsForWrite; other writer contracts remain. Dead preflight reassignment and misplaced runner/compact.ts comment removed.

Other reader ties

  • F56:refreshModelAuthStateAfterMutation serves refresh/login/order/logout and chat/plugin callbacks; only applied succeeds, order/logout retain committed-write warnings. Signal precedes await; agent/directory checks follow config/secrets/publication.
  • Test-shard registry readers: scripts/{check-tsgo-core-boundary,run-tsgo-core-test-shards,profile-tsgo}.mts, scripts/lib/tsgo-sparse-guard.mts and registry tests/selectors. One registry owns stripe/change routing; each new partition has separate build-info.
  • agents/model-auth-env.ts:resolveProviderEnvAuthEvidence → model-auth-availability.ts carries environmentVariable with marker/SecretRef/boundEnvVar; file/chain evidence unnamed. Readers: F26, status/status-model-auth.ts, F16, F29. models-auth-status-api-keys.ts and resolveProviderDirectAuthPlanningEvidence→F42 retain their rules; no new admission/retention policy.
  • cron-agent/run-prepare.ts:prepareCronRunContext, cron-agent/model-selection.ts:resolveCronModelSelection and src/cron/trigger-script.ts carry config through auth/fallback/execution/delivery/finalization. F47 preserves authored projection/bindings owned by F48.

Request/executable facts

Contract Producer, carriers and consumers
requestSelection/requestScope F38 → gateway/server-model-catalog-auth.ts → F02 → F27:LoadPreparedModelCatalogParams. Acquisition carries requested providers/session model/private auth.
profileSelections F01 produces row/acquisition preferences/pins. ProviderCatalogProfileSelections in agents/models-config.providers.secret-helpers.ts crosses prepared types/worker/scoped catalog and models-config/plan/implicit/secrets to order/pin handling; mutation retires private acquisition.
runtimeModels/providerSources Full-catalog WeakMap → getPreparedModelCatalogRuntimeModels → materializePreparedModelCatalogOwner → capturePreparedModelRuntimeCatalog → ModelRegistry.fork. preparedProviderCatalogSource excludes auth.profiles descriptors; order/models/plugins/env and credential/readiness checks remain. Saving A metadata preserves B models.
admittedProviderIds F22 → PreparedModelWorkerResult/loadCatalog → catalog-access replacement intersection. Mock producers: prepared-model-runtime.test-harness.ts and .startup-static.test.ts.
templateModelRegistry F22:382 builds executable rows; worker result reaches publication/fork.
refreshCommittedCatalogs Auth-publication absorbs the deleted helper; internal publication and F30:629,738 call it.
Completeness refreshPreparedModelRuntimeCatalog, Gateway catalogComplete/preparedSyntheticAuthComplete use admitted providers; gateway/session-utils-model.ts uses completeness for membership.
Private ownership isRequestCurrent fences in-process worker cancellation/publication; requestScope.authStore cannot replace shared auth/inventory. resolveCatalogAuthProfileOrder remains private in models-config.providers.secrets.ts; fullModelCatalogSnapshots remains module-owned.
Registered session proof methods/models-list.session-scope.integration.test.ts observes catalog Authorization, output limits, private-mutation cancellation, shared env keyRef/personal key and missing-variable/no-borrow. Native103 red retained; final128 passed.

resolveAuthProfileEligibility unchanged. sdk/agent-runtime.ts loaders omit requestSelection; getter reexports narrowed core. Shipped options/3 negative type assertions retained; correction compile pending. profiles/usage.ts/agents/model-fallback-runner.ts consume canonical order/awaited quota reprobe; markAuthProfileSuccess records existing lastProbeAt.

Correction consumer dispositions

Reviewed89f positions; RM1/earlier omissions are reviewer misses.

Consumer Disposition
commands/agent-exec.ts:302; commands/agent-exec-input.ts:212 Registered custom-config reader selects the exact file. RM1: its migration receipt must use that same file, not the environment default.
config/io.context.ts:68,71,202; config/io.load.ts:104; F49:240; config/io.recovery.ts:93 Selected-path producers and validation/recovery consumers. Carry selected config identity into the shared binding planner; RM1 now carries the selected identity.
agents/agent-model-discovery.ts:30,71 Declares and forwards captured admittedProviderIds to ModelRegistry.create; preserve an explicitly empty set.
agents/plugin-model-catalog.ts:740,742,773–777 Final generated-provider filter consumes captured admitted IDs and filters each deferred provider independently.
agents/prepared-model-runtime.build.ts:262,295,328 Calls moved batch preparation, fingerprinting and full-catalog access owners.
agents/prepared-model-runtime-lease.ts:325–327 Published executable models in the acquired lease; does not reacquire or infer auth.
agents/prepared-model-runtime.published-owner.ts:26 Same executable models in a retained published lease.
agents/model-catalog-view.ts:356 Prepared owner for the catalog view, preserving paired auth and executable facts.
agents/model-runtime-choice.ts:21 Prepared owner for runtime choice.
agents/openai-model-routes.ts:90–95 Forwards ProviderModelAuthSourcePlan, including preferredDirectSource, into the shared selector.
agents/prepared-model-runtime.types.ts:39–45 Private requestScope carries requested provider IDs, authStore and profileSelections; isRequestCurrent remains in-process.
gateway/worker-environments/inference-runtime.ts:99,317,338 Calls changed simple-completion preparation; consumes the same canonical auth plan.
src/tts/tts-core.ts:30,36,51 Lazy typed adapter exposes changed simple-completion preparation/acquisition; speech remains auxiliary scope, no new speech proof claim.
methods/models-auth-refresh.ts:28 Registered refresh consumes canonical completion; it must not acknowledge failed/pending application.
methods/models-auth-login.ts:145 Registered login consumes canonical refresh completion.
methods/models-auth-order.ts:53,125 Consumes canonical explicit order and refresh completion.
profiles/session-override.ts:326,378–380,410–417 Uses normal canonical order without owner-retained source for automatic session pin management; explicit user/user-link pins retain their separate early return. Final runtime preparation still owns working-source retention. No new session behavior proof claimed.
runner/cli-backend-dispatch-eligibility.ts:99 Normal order: CLI dispatch eligibility; no retained working-source argument.
runner/model.registry-resolution.ts:240 Normal order: registry model resolution; final auth preparation owns retained source.
agents/tools/model-config.helpers.ts:219 Normal order: model configuration/tool facts; does not publish a serving-source receipt.
agents/openclaw-plugin-tools.ts:246 Normal order: plugin tool credential selection; retained text-source memory is not passed.
infra/provider-usage.auth.ts:166,204,306,465 Normal order: auxiliary usage authentication; no retained text-serving-source claim.
methods/provider-usage-runtime.ts:72 Normal order: usage projection; separate from retained serving source.
agents/model-auth-label.ts:61 Normal order: fallback/inventory labels; prepared serving status uses the prepared decision owner.
agents/model-catalog-auth-labels.ts:57 Normal order: catalog auth labels; never replaces prepared serving facts.
agents/agent-auth-credentials.ts:159 Normal order to construct captured credential discovery facts; final runtime source selection remains separate.
agents/cli-execution-auth.ts:94,114 Normal order: CLI execution auth; no retained working-source argument.
agents/command/attempt-execution.ts:329 Normal order: command attempt auth; consumes the changed canonical eligibility rule.
doctor-shared/stale-auth-order.ts:534 Normal order to inspect stale order; no retained live source is available to Doctor.
plugins/provider-auth-availability-core.ts:273,288 Normal order: plugin availability; does not infer live retained source.
plugins/runtime/runtime-model-auth.ts:34 Normal order: the plugin auth adapter; consumes canonical selection.
agents/auth-profiles.ts:22–23; agents/auth-profiles.runtime.ts:2 Canonical selector reexports; no copy/second owner.
agents/prepared-model-catalog-worker.test.ts:54 Fixture produces captured admitted IDs.
agents/prepared-model-catalog-worker.integration.test.ts:965 Real-worker fixture produces captured admitted IDs.
agents/prepared-model-catalog-worker.mismatch.integration.test.ts:122 Mismatch fixture produces captured admitted IDs.
agents/prepared-model-catalog-worker.test-support.ts:682 Shared worker fixture materializes the prepared owner.
methods/models-list-result.session-binding.test.ts:137 Asserts request session selection reaches acquisition; supplemental to registered session-scope proof.
F34=sdk/agent-runtime-model-catalog-contract.test.ts:31,33,36 Checks that all three public catalog signatures exclude requestSelection; final strict external compile is the declaration proof.
plan/catalog-provider-admission.test.ts:329 Calls changed family-catalog helper; owner-boundary supplemental coverage.
sdk/provider-catalog-live-runtime.scope.test.ts:22 SDK family-catalog call.
sdk/provider-catalog-live-runtime.strict.test.ts:95 SDK family-catalog call.
profiles/order.test.ts:458,473,595,600 Metadata-order selector coverage.
runner/run.overflow-compaction.harness.ts:434,854,958 Typed selector result/canonical-order mocks retain return contract.
agents/model-runtime-aliases.test.ts:247 Mocks canonical metadata-order mock.
agents/provider-auth-aliases.test.ts:216 Calls canonical metadata order.
agents/test-helpers/embedded-agent-runner-e2e-mocks.ts:306,326 Mocks canonical order to runner mocks.
reply/commands-login.harness-test-support.ts:85 Required host refresh callback.
sdk/provider-auth-login-flow-runtime.refresh.test.ts:66,132,166 Produces reconciliation callback and calls the changed login-refresh helper; public/private SDK limits remain explicit.
methods/models-auth-refresh.test.ts:51,80,87,90,118,137,162 Registered refresh reconciliation outcomes.
methods/models-auth-status.test.ts:63,169,229,259 Typed health/reconciliation fixtures.
plugins/openai-compatible-embedding-provider.integration.test.ts:228 Raw auth-store writer; auxiliary embedding fixture, publication/transaction contract unchanged.
commands/doctor-auth-shared-receipt.test.ts:69 Raw delete now uses publication locking; same database/owner transaction/receipt fixture.
F35=gateway/server-startup-copied-auth-secretref.test.ts:31 Raw delete now uses publication locking; same database/owner/startup fixture.
F36=infra/state-migrations.shared-auth-store.test.ts:103 Raw delete now uses publication locking; same database/owner/migration fixture.

Auth-store writers below use the new publication owner with the supplied database/owner/managed transaction; fixture roles unchanged, no new live proof.

  • agents/agent-model-discovery.auth.test.ts:68
  • agents/auth-profiles.permissions.test.ts:70
  • agents/auth-profiles.sqlite-store.test.ts:279
  • profiles/legacy-source-diagnostic.test.ts:102
  • profiles/oauth-manager.settlement-validation.test.ts:103
  • profiles/oauth-refresh-fence.async.test.ts:119
  • profiles/oauth.concurrent-agents.test.ts:287
  • profiles/path-resolve.shared-store.test.ts:63
  • profiles/profiles.test.ts:426
  • profiles/source-check.test.ts:22
  • profiles/store-owner-publication.test.ts:257
  • profiles/store-state-owner.test.ts:387
  • profiles/usage.inherited-owner.test.ts:183
  • runner/run/auth-plan.auth-pin.test.ts:90
  • runner/run/model-setup.selected-model.test.ts:93
  • agents/model-auth.profiles.test.ts:464
  • sessions/auth-storage.oauth-refresh.test.ts:141
  • sessions/auth-storage.publication.test.ts:47
  • sessions/auth-storage.test.ts:157
  • sessions/sdk.auth-migration.test.ts:94
  • commands/agent-exec.auth.test.ts:156
  • commands/agents.delete.test.ts:229
  • commands/doctor-auth-flat-profiles.test.ts:298
  • commands/doctor-auth.hints.test.ts:94
  • commands/doctor-auth.profile-health.test.ts:73
  • commands/doctor-auth.shared-health.test.ts:60
  • commands/doctor-lint.state-isolation.test.ts:430
  • commands/doctor-model-catalog-credentials.test.ts:281
  • commands/doctor-state-migrations.test.ts:931
  • commands/doctor.auth-profile-consumers.e2e.test.ts:339
  • commands/doctor/auth-alias-import-recovery.test.ts:33
  • commands/doctor/auth-alias-migration.test.ts:57
  • commands/doctor/auth-alias-preservation.test.ts:40
  • doctor-shared/stale-auth-order.test.ts:88
  • doctor-shared/stale-oauth-profile-shadows.test.ts:341
  • methods/models-auth-refresh.integration.test.ts:49
  • gateway/server-startup-config.secrets.test.ts:384
  • F35:45
  • F36:77
  • src/secrets/audit.test.ts:54
  • test/e2e/qa-lab/runtime/codex-native-approval-receipt.e2e.test.ts:242
  • test/helpers/stage-live-auth-profiles.test.ts:31
  • test/oauth-refresh-authority-chain.e2e.test.ts:413
  • test/test-env.test.ts:250

Seven source-project rows

Consumer Disposition
F37=agents/prepared-model-runtime.startup-static.test.ts:151:9 Typed admitted-set read → local worker mock array → catalog-access; agents-root typecheck/agents-core runtime.
F34:11:3 Core-getter mock for legacy cache-only read; unknown[] is not public-type proof.
F34:16:3 SDK getter directly re-exports core :282–283; no requestSelection.
F34:17:3 Legacy loader import/compatibility/cache-only/writable consumers.
F34:18:3 Prepared loader import; private selection excluded, writable default.
F34:48:9 Shipped thinking callback → core loadRuntimeCatalog; result/invocation checks.
F34:62:9 Same callback's exact failure-propagation consumer.

Projects: test-project/agents-root.json; all6 SDK rows F57=test-project/sdk.json/runtime plugin-sdk. Source only; core queries exclude both files. C8 limits below.

Config-file receipt correction

IO-selected configPath reaches load/snapshot/backup/prefix recovery/include-write/preflight and the binding planner. No second env lookup or object-only receipt. Registered commands/agent-exec.configless.test.ts opposite-receipt cases fail on89f/pass RM1; bindings correct, files/receipts unchanged. No schema/receipt-format change.

Validation and correction consumers

Reviewed8f positions; object-only tests/mocks are not upgrade proof. TUI/getter omissions are earlier reviewer misses.

Consumer Disposition
config/config.ts:88 Re-exports changed validator; same implementation.
system-agent/setup-apply.ts:460; system-agent/operations-execution-helpers.ts:480–508 RM2: setup-apply.ts:461 carries committed.path to existing planner for expected runtime; independent full-route guard/source-only write remain. Registered8f red/ac6d green.
src/hooks/gmail-ops.ts:94,230 Loaded snapshot → derived object validation → replaceConfigFile(validated.config). No ambient receipt lookup; existing provider values are input, not a receipt decision. No new Gmail proof.
methods/config.ts:582,1121,1162; methods/config-write-flow.ts:253,272 Candidate supplies defaults/secret checks/reload comparison. Canonical writer receives source; final response consumes committed reread (config.ts:709), not candidate. File loader owns bindings.
reply/config-mutations.ts:26 Consumes validation success/errors; returns original source, not defaults/bindings.
config/mcp-config.ts:144 Consumes validity/errors and writes source; later file loader owns receipts.
doctor-shared/invalid-plugin-config.ts:12 Consumes issues to select invalid plugins; ignores runtime config.
gateway/test-helpers.config-runtime.ts:273 Fixture consumes validity/issues/warnings, not returned runtime config.
system-agent/setup-apply.test-harness.ts:187; system-agent/setup-apply.test.ts:710,772 Setup object materialization/spies. Existing plugin-default cases do not prove RM2 memory-only bindings.
test/test-env.ts:399 Optional live-config normalization serializes object-only materialization; no ambient receipt bindings.
config/config.plugin-validation.test.ts:172 Aliased wrapper forwards options; consumes plugin defaults/errors. No receipt without file identity.
config/config.web-search-provider.test.ts:265 Object-only web-search validation.
config/validation.channel-metadata.test.ts:279 Metadata/defaults/validation-mode results.
config/validation.dm-policy.test.ts:122 Channel warning results.
config/commands.test.ts:282 Command-config validation.
config/config.hooks-session-mode.test.ts:6 Hook session-mode validation.
config/config.hooks-module-paths.test.ts:7 Hook path validation.
config/config.model-ref-validation.test.ts:67 Model-reference/plugin-mode validation.
config/validation.policy.test.ts:368 Heartbeat ownership warning wrapper.
F58=config/mutate.test.ts:60,1990 R3: validator mock/exact include-write assertion adopts selected file/env; skip-policy, warning-before-write, include bytes/backup preserved. 83 owner tests pass.
config/mcp-config.test.ts:61 Mocks validation for source-only writes.
reply/commands-gating.test.ts:124 Mocks command-gating validation.
reply/commands-allowlist.test.ts:35 Mocks source-mutation validation.
reply/commands-plugins.test.ts:65 Mocks plugin-mutation validation.
doctor-shared/automatic-startup-config-repair.test.ts:47 Object-only plan assertion; not selected-file receipt proof.
doctor-shared/invalid-plugin-config.test.ts:11 Mocks invalid-plugin outcomes.
commands/doctor-config-flow.test.ts:353 Mocks Doctor validation.
gateway/server-plugin-reload.installed-package.test.ts:298 Installed-plugin reload object materialization.
methods/config.shared-auth.test.ts:74,205 Shared-auth candidate-validation fixtures.
methods/config.test.ts:43 Registered config-handler validation fixtures.
plugins/native-session-catalog-registration.test.ts:105 Plugin defaults before registration; no supplied file receipt.
F55:551,557 Nonblocking published catalog → verified-shell thinking defaults, separate from empty listModels; no discovery. Earlier reviewer miss.
system-agent/tui-backend.test.ts:25,261 Getter mock/verified-shell assertion protect startup without catalog preparation.
agents/prepared-model-catalog.test.ts:266,461,462,608 Direct getter: read-only/published snapshot selection.
agents/prepared-model-catalog.scoped-thinking.test.ts:300 Published snapshot after scoped thinking preparation.
F37:241,611 Getter import/read plus documented admission fixture.
methods/models-auth-refresh.overlap.test-support.ts:19 Fixture owns registered refresh/config/shutdown setup and held calls.
methods/models-auth-refresh.overlap.integration.test.ts:5,36,69,109 Fixture consumers: overlap, failed-only release, owner replacement, shutdown joining.
agents/prepared-model-runtime.scoped-refresh.test.ts:7,40 Moved servePreparedModelRuntimeCatalog fixture; assertions retained.
telegram/bot-native-command-login.test-support.ts:30,82,86 Renamed fixture reader supplies session lookup/patch.
telegram/bot-native-command-login.session.test.ts:19,96,151,196,267,341; telegram/bot-native-command-login.test.ts:485 Seven renamed-record producers; session contract unchanged.
reply/commands-status-auth.test.ts:18 Registered status → concrete usage loader.
methods/models-list-result.cli-runtime-availability.test.ts:393 Explicit CLI fixture consumes admission/readiness; unavailable assertion retained.
methods/models-list.captured-config.integration.test.ts:14,82 Captured-config forwarding retains explicit fields.
methods/models-auth-explicit-family-order.integration.test.ts:258,266 Explicit-family fixture and retained recovery guard.
test-project/gateway-models.json:6; test-project/gateway-other.json:12; F57:6; test-project/services.json:10 New partitions/matching exclusions registered at F31:31,63; exact-once/root limits unchanged.
Consumer Disposition
system-agent/operations.setup-provider-binding.test.ts:44,48,60,74,100,109,113,125 Registered approved openclaw.setup consumer: real file snapshots and provider-binding facts reach the real credential resolver before and after setup. Checks unchanged route and credential, source-only config, absent migration receipt, workspace/session creation and completion. Inference transport is injected; no live inference claim.
profiles/sqlite.ts:inspectAuthProfileJsonCell Query-local payload feeds the same parser/inspection result; public readers and shared-state storage stay unchanged.
runner/run-loop.ts:runPreparedEmbeddedLoop Consumes normalizeEmbeddedRunAttempt carryover once for retry/proceed after the terminal guard; same state and retry budget.

Contention

  • Account publication/Doctor rename remain guarded through SQLite commit/rollback; request/receipt owner supersedes stale work, never replays success.
  • Registered hold5.019s; concurrent session list/edit/readback2.031/6.579/2.777ms.
  • models.authLogout during held acquisition: initial list rejects stale catalog; later lists empty; sibling turn works. Response cancelled before release; no late-parser claim.

Invalidation

  • RM2: committed.path → expected runtime/shared planner; observed runtime independently loads file. Full route guard; no ambient/second lookup or copied observation. Registered setup passes.

  • Credential removal/replacement/order/route, env withdrawal, endpoint/model/plugin changes, expiry and successful empty same-account refresh revoke retained facts; stale completion cannot publish.

  • Added auth.profiles metadata preserves working learned rows; credential/readiness still decides retention. Retained registered proof checks the same key/output limit.

  • Auth refresh signals before config await and rechecks scope/publication. Groups/registries/workers carry admitted IDs; session projection cannot widen them.

  • Root/include revisions and separate raw-root/updater hashes remain current. Selected custom/default files have distinct receipts; load/recovery/preflight must use IO-selected identity. Both registered opposite-receipt cases pass.

  • Plugin/browser connection/request/refresh generations retire copies; missing availability is unknown, discovery is not provider-wide readiness.

  • get-reply.types.ts, commands-login.ts, chat-send-agent-dispatch.ts and server-plugins.ts bind callbacks across awaits. Generic gateway.request rejects stale output. Google Meet/Workboard/meeting-browser/voice-call/meeting-tool retain error paths and committed effects; server-plugins.test.ts is boundary proof only.

Tests

Behavior Entry points / tests
CI owner cleanup 101 tests: auth-profile SQLite inspection/read/write; embedded attempt normalization; native completion; worker/secrets/scoped catalogs; registered models.authRefresh/config.patch/Gateway shutdown. Full CI owns type-aware lint.
Setup post-write binding operations.setup-provider-binding.test.ts: approved openclaw.setup → executeSystemAgentOperation/executeSetup/applySystemAgentSetup, real file load.8f exit1 at post-write route guard; ac6d exit0. Checks same credential, source/receipt, workspace/session writes/completion. RM1 opposite receipts retained.
Include write 83 pass; replaceConfigFile in F58 checks selected path/env, pluginValidation skip, warning before write, include bytes and backup.
Admission/keys/family runtime-plan/provider-use-admission.test.ts; provider-model-route-auth.test.ts; runtime-plan/model-fallback.own-env.test.ts; src/secrets/provider-env-vars.test.ts
Account/catalog/output limits Registered models.list/authRefresh/agent in models-auth-refresh.retained-catalog.integration.test.ts; prepared-model-runtime.sources.test.ts
Removal/order/status models.authLogout/authOrderSet/authStatus; server.models-auth-order.test.ts; models-auth-status-serving.integration.test.ts
Startup/Doctor/publication doctor/shared/provider-use-binding-migration.test.ts; doctor-provider-use-binding-write.test.ts; config-reload.test.ts; config/state corpus
Generation/completion/notice run.plugin-runtime-refresh.integration.test.ts; simple-completion-runtime.route.test.ts; run/terminal-resolution.auth-notice.test.ts; Telegram native-login/session suites
Refresh/catalog fixtures Registered models.authRefresh/config.patch/Gateway close: models-auth-refresh.overlap.integration.test.ts covers failed-only, same-scope successor/other-agent, shutdown join. scoped-refresh.test.ts → prepared-model-runtime.test-harness.ts:servePreparedModelRuntimeCatalog; assertions unchanged.
  • CI34703944345: three failed jobs: diff-caused lint(12 errors), recurring catalog poll timeout, aggregate. Prior ac6d subset:53 pass; base444 same poll fails with recorded limits. Lint repair:101 tests/syntax/line/assertion guards pass. Full CI pending; no retry/new live/older-host proof.

Retained proof stays at its recorded revision:

  • Corpus:19 retained fixtures; hamverbot/operator-container/peanutto pass on89f after fix(models): capture startup auth facts for scoped catalogs #145859: each Doctor/startup/shutdown,4 JSON catalog calls(12 total). Offline unavailable outcomes remain; no inference/connectivity or single-head22-case claim.
  • Unchanged9.4: BytePlus/Volcengine install/catalog/onboard, Moonshot own-key isolation, Bedrock account/discovery-disabled pass. Doctor-first9.3 state:177 pass. Genuine9.4 updater→202abff4 env-only/no-env/account+env pass; backups/sessions/history retained; service-env/rollback unproved. Shipped Bedrock declaration-only filtering red; account passes, chain declaration needs candidate core.
  • Retained:73 config/state; SDK0824 shipped/10 candidate private-JS; Telegram save retains B/one fallback notice(not native /login/browser). Rebase100=80completion+13catalog+7Doctor/cron; SDK11813 owner/sibling;89f2 registered isolated-quota.
  • Final128:18 cases on89f preserve family B after exact A,4096-token limit, session/captured scope, concurrent removal, replacement/order/endpoint/plugin/empty/expiry. C4:330 declarations/143files/22moves are mappings, not execution counts.
  • References: base core/UI/scripts,8 extension groups,4 package projects retained;195 queries/188 resolved/7 outside-core source dispositions(no new queries).2330core20+6 recovered fields pass. Failed memory-limited runs/prefixes retained; batches stopped by instruction.
  • Round4:118 pass. Filtered include42 pass/2 fail lacked prior mock setup; full owner83 pass. CI subset:53 head pass; base45 Talk pass/8 catalog fail(four same poll/four later). Not full-shard proof.
  • CI34700398174 failed.126 cases pass across runs(not one run); wrapper/session/unused-exports/syntax checks pass. Type-aware lint hit6GiB; CI owns completion. A-catalog poll:89f pass/base2bfa same assertion fails with identical added test; not a both-green flake. Failed attempts retained.

Shipped SDK proof

Export Retained package proof
agent-harness-runtime.prepareAgentRuntimeAuth Genuine9.4(3a9d69d) and candidate strict external compile;4 shipped/8 candidate auth cases, including candidate-only preferences.
agent-sessions.ModelRegistry Private-JS/no declarations:5 shipped/8 candidate create/options/fork/refresh cases. Shipped generated inventory expands family; candidate scopes admission. Both available inventories stay credentialed.
SDK082 family/login callbacks Actual9.4/updater202abff packages:4 shipped/10 candidate private-JS cases; not the exports/types above.

C8: strict real Node/WebSocket types, unchanged inventories;3 catalog types exclude requestSelection/shipped options compile;3 old errors retained. Catalog calls compile-only;9 shipped/16 candidate behavior counts overlap. Predates getter correction, not current-graph proof. Artifacts: shipped9.4 tar,89f package130,matrix132; SHA256 identities retained in result.md.

@obviyus
obviyus requested a review from a team as a code owner September 11, 2026 07:30
@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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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, 12:12 PM ET / 16:12 UTC (Revision 34).

ClawSweeper review

What this changes

The PR centralizes provider admission, preserves working automatic credentials when accounts are saved, reports the serving credential source, and adds shared startup and Doctor binding migration.

Merge readiness

⛔ Blocked before merge - 7 items remain

This protected PR retains distinct credential-policy work beyond the merged catalog and login fixes. No new blocking defect was established in the examined owner paths; the documented compatibility tradeoff remains unresolved.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful owner-centered implementation with substantial bounded proof and no established blocking code finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Retained Telegram results demonstrate working-source retention and one fallback notice; recorded registered Gateway runs cover credential-scoped catalog and inference behavior, including account replacement. Published-updater results remain attributed to 202abff, Gateway cases to 89f4613, and the latest setup regression is supplemental rather than a new live-deployment claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Retained Telegram results demonstrate working-source retention and one fallback notice; recorded registered Gateway runs cover credential-scoped catalog and inference behavior, including account replacement. Published-updater results remain attributed to 202abff, Gateway cases to 89f4613, and the latest setup regression is supplemental rather than a new live-deployment claim.
Evidence reviewed 13 items Pinned contribution and review continuity: The introduced file list was inspected against merge base 2330d13. GitHub comparison with the previous reviewed head identifies the selected-config-path correction, narrowed catalog getter, setup correction, and test changes. The supplied test merge is stale and was not used to claim removal of main behavior.
Current-main and release distinction: Fetched main and v2026.9.4 contain the existing declared-versus-ambient source planner, but not this PR’s provider-use admission implementation. The merged related login, client-freshness, Vertex, and startup-capture fixes do not establish supersession of this policy change.
Released source inspected through GitHub: The v2026.9.4 source was retrieved through GitHub after the local historical blob read failed; it lacks the new admission owner and retained direct-source field.
Findings None None.
Security None None.

How this fits together

OpenClaw’s model runtime combines provider configuration, saved accounts, and plugin-declared environment credentials to choose authentication for discovery and inference. Gateway, CLI, and chat consumers use those prepared decisions, while Doctor owns persistent upgrade repairs.

flowchart TD
  A[Provider configuration] --> D[Shared provider admission]
  B[Saved accounts] --> D
  C[Plugin credential declarations] --> D
  D --> E[Prepared credential selection]
  E --> F[Discovery and inference]
  E --> G[Gateway CLI and chat status]
  H[Doctor upgrade repair] --> A
Loading

Decision needed

Question Recommendation
Do the auth/storage and SDK owners accept this provider-binding cutover, including deferred-binding operator recovery and the documented service-environment and rollback proof limits? Accept the documented cutover: Record owner acceptance of the shared admission policy, migration publication contract, and SDK compatibility limits.

Why: The remaining question changes supported credential and upgrade behavior; source correctness and successful bounded runs cannot establish that product acceptance.

Before merge

  • Resolve merge risk (P1) - Existing shared-key or cloud-chain routes can stop working when binding migration is deferred by account conflicts or unavailable upgrade state, requiring explicit provider configuration.
  • Resolve merge risk (P1) - The retained published-updater cases do not establish service-environment or rollback behavior.
  • Resolve merge risk (P1) - The SDK changes credential-selection behavior and requires host-bound login refresh callbacks; acceptance of the documented shipped-versus-main-only compatibility boundary remains unrecorded.
  • Complete next step (P2) - Record auth/storage and SDK owner acceptance of the provider-binding cutover and its documented upgrade limits.
  • 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 and test growth Production/tooling net +4,209 lines; tests/support net +10,981 lines Growth has a stated purpose in shared admission, credential retention, migration fencing, and registered regression coverage.

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. Accept the bounded credential-policy change (recommended)
    Auth/storage and SDK owners can accept the documented migration limits and operator recovery requirements.
  2. Resolve service-upgrade uncertainty
    Add published-driver service-environment and rollback evidence before accepting the changed credential defaults.

Technical review

Best possible solution:

Keep one admission and Doctor migration owner, with explicit auth/storage and SDK acceptance of the upgrade contract and its remaining service-environment and rollback limits.

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

Yes for the bounded credential-selection scenarios documented in the retained production-path results and regression coverage; this review inspected their source but did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes structurally: shared admission, prepared source identity, and Doctor-owned persistence avoid competing policies. Whether the stricter activation contract is acceptable remains an owner decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5ba72cc78e39.

Labels

Label justifications:

  • P2: This is substantive provider-authentication work without evidence of an emergency caused by the proposed patch.
  • merge-risk: 🚨 compatibility: Provider activation, persistent upgrade repairs, and SDK credential semantics change existing contracts.
  • merge-risk: 🚨 auth-provider: Deferred bindings can leave previously usable shared-key or cloud-chain routes unavailable until explicitly configured.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 Telegram results demonstrate working-source retention and one fallback notice; recorded registered Gateway runs cover credential-scoped catalog and inference behavior, including account replacement. Published-updater results remain attributed to 202abff, Gateway cases to 89f4613, and the latest setup regression is supplemental rather than a new live-deployment claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained Telegram results demonstrate working-source retention and one fallback notice; recorded registered Gateway runs cover credential-scoped catalog and inference behavior, including account replacement. Published-updater results remain attributed to 202abff, Gateway cases to 89f4613, and the latest setup regression is supplemental rather than a new live-deployment claim.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Credential fallback notices and chat authentication outcomes are Telegram-visible; retained Telegram proof is relevant.

Evidence

What I checked:

  • Pinned contribution and review continuity: The introduced file list was inspected against merge base 2330d13. GitHub comparison with the previous reviewed head identifies the selected-config-path correction, narrowed catalog getter, setup correction, and test changes. The supplied test merge is stale and was not used to claim removal of main behavior. (ac6d463f132c)
  • Current-main and release distinction: Fetched main and v2026.9.4 contain the existing declared-versus-ambient source planner, but not this PR’s provider-use admission implementation. The merged related login, client-freshness, Vertex, and startup-capture fixes do not establish supersession of this policy change. (src/agents/provider-model-auth-source-plan.ts:1, 5ba72cc78e39)
  • Released source inspected through GitHub: The v2026.9.4 source was retrieved through GitHub after the local historical blob read failed; it lacks the new admission owner and retained direct-source field. (src/agents/provider-model-auth-source-plan.ts:1, 3a9d69db306c)
  • Environment-source concern addressed: Credential resolution now consumes plan.boundEnvVar; the environment resolver restricts lookup to that variable. Focused coverage checks withdrawal and rotation through both the prepared resolver and ordinary auth controller, addressing the concern raised at fix(models): require provider-bound credentials for provider use #144768 (comment). (src/agents/runtime-plan/resolve-auth.ts:284, ac6d463f132c)
  • Migration authority and compatibility: The planner defers generated bindings when saved accounts conflict or required variables are unavailable. Doctor revalidates under the shared credential-publication lock immediately before config publication; startup only projects bindings in memory. (src/config/provider-use-binding-plan.ts:298, ac6d463f132c)
  • Selected-file correction: Setup passes committed.path into runtime validation, keeping expected binding projection tied to the committed file. The added registered setup regression preserves source configuration and the incomplete migration receipt while checking the same serving credential. (src/system-agent/setup-apply.ts:461, ac6d463f132c)

Likely related people:

  • openclaw/openclaw-secops: 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)
  • obviyus: 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.

  • Record auth/storage and SDK acceptance of the changed credential policy and documented upgrade limits.

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 (33 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-11T22:30:57.850Z sha 5e21c0f :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-11T23:34:27.189Z sha 24225ec :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-11T23:54:10.884Z sha a7df4ea :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T00:19:52.750Z sha 6639a94 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T01:10:21.862Z sha a0b2888 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T02:36:22.332Z sha a0b2888 :: blocked before merge. :: none
  • reviewed 2026-09-12T11:47:35.158Z sha 0c9ed8a :: blocked before merge. :: none
  • reviewed 2026-09-12T15:01:22.943Z sha 89f4613 :: blocked before merge. :: none

@obviyus
obviyus force-pushed the feat/provider-use-admission branch from aeb8ac6 to bb882cd Compare September 11, 2026 09:09
@obviyus obviyus changed the title fix(models): require bound credentials before provider use fix(models): require provider-bound credentials for provider use Sep 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations size: XL and removed size: L labels Sep 11, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 11, 2026
@TheAngryPit

Copy link
Copy Markdown
Contributor

My take is that the central admission decision makes sense. Having a key available and choosing to use a provider are different things, and checking authored config before route projection seems like the right place to draw that distinction.

I read 4d064dcc, including the latest upgrade changes. Keeping the receipt open when the service key is missing and rechecking saved accounts before writing both make the transition clearer to me.

A few questions came up while following the code. I may be missing context around how these paths are used:

  • Would it make sense to carry the admitted environment variable in the prepared plan? Credential resolution recomputes the binding, and a missing binding passes boundEnvVar: undefined, which leaves normal lookup unrestricted. I was thinking of OPENAI_API_KEY disappearing after preparation while CODEX_API_KEY remains. My preference would be to fail or prepare again rather than change the selected source, but I haven't reproduced that sequence.

  • How do you see deliberate removal working during a partial migration? The partial-conflict case can leave one binding written and completion open. If someone removes that provider entry while leaving its model selected, the next pass appears able to propose it again. The removal test covers an already completed migration. I'd lean toward preserving the removal, though that does add state to the transition.

  • For credentialProviderId, is the all-configured-targets exception the intended compatibility rule? Reading it, adding a profile-bound or environment-bound sibling to the same hook changes whether an outside shared source is allowed. I would find a destination/source decision easier to reason about than one that depends on the other targets in the call.

That's where my reading landed. This is a source-only opinion with AI assistance, including an independent Daybreak reading of the SDK path. I haven't run these scenarios or independently reproduced the runtime evidence in the PR.

@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 11, 2026
@obviyus
obviyus force-pushed the feat/provider-use-admission branch from 0c9ed8a to 89f4613 Compare September 12, 2026 14:49
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 12, 2026
@obviyus

obviyus commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this without merging. It grew to 344 files and changes too much behavior in one change to review or roll back safely. The work will come back as a stack of smaller, owner-scoped PRs (admission owner and binding planner, Doctor binding migration, config selected-path identity, per-surface adapters, SDK types), each with its own proof. The branch stays for that split.

@obviyus obviyus closed this Sep 12, 2026
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: telegram Channel integration: telegram cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: amazon-bedrock extensions: anthropic extensions: byteplus extensions: moonshot extensions: volcengine 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. 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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.

2 participants