feat!: isolate provider configuration per run - #93
Conversation
There was a problem hiding this comment.
The run-scoped provider snapshot implementation is well-structured and addresses the concurrency concern correctly. The changes ensure provider/credential pairs are atomic and isolated per admitted run, preventing race conditions when switching models during concurrent execution. Documentation updates across AGENTS.md, README.md, and the API surface doc properly explain the new behavior and migration path for embedders.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Codex review — blocking findingPublic API removals are not versioned as breaking changes. This diff removes the public Before merge, choose one explicit contract:
A public-surface/compile regression test would prevent this from being missed again. All runtime isolation tests, full tests, Review status: keep open; not ready to merge until the API/versioning decision is resolved. |
Recommended resolutionI recommend treating this as an intentional A shim for Concrete changes before merge
This keeps the implementation small, makes the break honest, and preserves the run-isolation invariant without carrying unsafe legacy global state. |
|
Implemented the requested release-contract changes in 605297a:
The versioning/documentation blocker is resolved from my review standpoint. This PR remains open and unmerged for human review; no merge action will be taken. |
monatis
left a comment
There was a problem hiding this comment.
Merging this PR, but we need to remove the legacy two-stage provider switching to prevent any misuse. altai-app should exclusively use switch_provider_with_credentials, and isanagent should be free from legacy artifacts after migration.
Status
Replacement review PR for #90. The original PR was merged accidentally and cannot be reopened by GitHub. PR #91 removed its changes from
main; this PR restores the change for review and must remain open until a human explicitly authorizes merge.Review only: do not merge automatically.
Breaking 0.11 change
This PR deliberately versions the provider-isolation work as IsanAgent 0.11.0. It removes process-global and independently mutable provider configuration instead of adding unsafe compatibility behavior.
set_fallback_providers(specs)AgentLogic::new_with_fallback_providers(params, specs)agent.provider_credentials_handle()plus independent writesswitch_provider_with_credentials(provider, credentials).awaitswitch_providerandset_provider_credentialsremain temporary shims with documented limitations. New integrations should use the atomic provider-plus-credentials API.What changed
AgentLogicRisk review
The behavioral boundary is admission time: an active run retains its old provider; an inbound accepted after a model switch retains the new provider even while queued. Fallback keys stay instance-local and Debug output is redacted. Manual compaction has no run admission and intentionally reads the current instance provider.
Validation
cargo check --all-featurescargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --doc --all-features(1 passed)cargo test --all-features(445 passed, 0 failed, 6 ignored; plus 1 doctest)git diff --checkOriginal PR: #90