singularity-forge/packages/pi-coding-agent/src/core
Jeremy 9fe13da3f2 fix(pi-coding-agent): resolve model fallback race that ignores configured provider (#3534)
Extension-provided models (e.g. claude-code/*) were unavailable during
findInitialModel() because pendingProviderRegistrations had not been
flushed yet, causing the fallback chain to select Google Gemini even
when the user explicitly configured claude-code as their default.

Three compounding issues fixed:

(A) Flush pendingProviderRegistrations in createAgentSession() before
    findInitialModel() runs, so extension models are in the registry
    when initial model selection happens.

(B) Re-apply the validated model to the session after
    validateConfiguredModel() in both print and interactive CLI paths.
    Previously, validation updated settingsManager but never called
    session.setModel(), leaving the session on the wrong model.

(C) Update defaultModelPerProvider.anthropic from "claude-opus-4-6[1m]"
    to "claude-opus-4-6" — the [1m] variant was removed from the model
    registry when the base model was upgraded to 1M context, causing the
    Anthropic fallback to silently fail and skip to Google.

Closes #3534
2026-04-05 07:14:24 -05:00
..
compaction fix(compaction): add chunked fallback when messages exceed model context window (#3038) 2026-03-30 14:47:41 -06:00
export-html refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00
extensions fix(perf): share jiti module cache across extension loads (#3308) 2026-04-05 07:59:17 -04:00
lsp fix(lsp): add legacy alias for renamed kotlin-language-server key 2026-04-04 11:45:58 -05:00
tools fix(read-tool): clamp offset to file bounds instead of throwing (#3007) (#3042) 2026-03-30 14:48:01 -06:00
agent-session-model-switch.test.ts fix(pi-coding-agent): cancel stale retries after model switch 2026-04-03 16:21:21 +02:00
agent-session.ts fix(pi-coding-agent): cancel stale retries after model switch 2026-04-03 16:21:21 +02:00
artifact-manager.ts feat: TTSR + blob/artifact storage (ported from oh-my-pi) 2026-03-13 08:43:56 -06:00
auth-storage.test.ts fix: detect and block Gemini CLI OAuth tokens used as API keys (#3296) 2026-04-05 01:05:08 -04:00
auth-storage.ts fix: detect and block Gemini CLI OAuth tokens used as API keys (#3296) 2026-04-05 01:05:08 -04:00
bash-executor.ts fix(windows): prevent EINVAL by disabling detached process groups on Win32 (#2744) 2026-03-26 16:08:03 -06:00
blob-store.ts fix: resolve race conditions in blob-store, discovery-cache, and agent-loop 2026-03-22 22:30:44 -03:00
compaction-orchestrator.ts fix(core): address PR review feedback for non-apikey provider support (#2452) 2026-03-25 08:45:20 -06:00
constants.ts refactor: centralize magic numbers into constants.ts (#1044) 2026-03-17 18:45:43 -06:00
defaults.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
diagnostics.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
discovery-cache.test.ts test: replace shape-only assertions with value checks (#1875) 2026-03-21 15:25:10 -06:00
discovery-cache.ts fix: resolve race conditions in blob-store, discovery-cache, and agent-loop 2026-03-22 22:30:44 -03:00
event-bus.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
exec.ts fix: add Windows shell guard to remaining spawn sites (#3058) 2026-03-30 14:44:20 -06:00
fallback-resolver.test.ts feat(core): support for 'non-api-key' provider extensions like Claude Code CLI (#2382) 2026-03-24 15:50:12 -06:00
fallback-resolver.ts feat(core): support for 'non-api-key' provider extensions like Claude Code CLI (#2382) 2026-03-24 15:50:12 -06:00
footer-data-provider.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
fs-utils.test.ts refactor(test): replace try/finally with beforeEach/afterEach in packages tests (#2390) 2026-03-24 21:34:10 -06:00
fs-utils.ts fix: failure recovery & resume safeguards (all 4 waves) (#956) 2026-03-17 16:03:49 -06:00
image-overflow-recovery.test.ts fix: recover from many-image dimension overflow by stripping older images (#3075) 2026-03-30 14:40:35 -06:00
image-overflow-recovery.ts fix: recover from many-image dimension overflow by stripping older images (#3075) 2026-03-30 14:40:35 -06:00
index.ts feat(extensions): wire up topological sort and unified registry filtering (#3152) 2026-03-31 11:54:48 -06:00
keybindings.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00
lifecycle-hooks.test.ts fix(core): address PR review feedback for non-apikey provider support (#2452) 2026-03-25 08:45:20 -06:00
lifecycle-hooks.ts fix(core): address PR review feedback for non-apikey provider support (#2452) 2026-03-25 08:45:20 -06:00
local-model-check.ts feat: complete offline mode support (#2429) 2026-03-24 22:35:45 -06:00
lock-utils.ts refactor: extract shared file lock utilities 2026-03-19 15:16:56 -03:00
messages.test.ts fix: prevent LLM from confusing background task output with user input (#3069) 2026-03-30 14:42:56 -06:00
messages.ts fix: prevent LLM from confusing background task output with user input (#3069) 2026-03-30 14:42:56 -06:00
model-discovery.test.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
model-discovery.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
model-registry-auth-mode.test.ts fix(model-registry): scope custom provider stream handlers to prevent clobbering built-in API handlers 2026-03-25 22:33:48 +01:00
model-registry-discovery.test.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
model-registry.ts fix(interactive): fully remove providers from /providers (#2852) 2026-03-27 09:53:35 -06:00
model-resolver.ts fix(pi-coding-agent): resolve model fallback race that ignores configured provider (#3534) 2026-04-05 07:14:24 -05:00
models-json-writer.test.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
models-json-writer.ts feat: dynamic model discovery & provider management UX (#581) 2026-03-16 06:23:18 -06:00
package-commands.test.ts fix(core): address PR review feedback for non-apikey provider support (#2452) 2026-03-25 08:45:20 -06:00
package-commands.ts feat(core): support for 'non-api-key' provider extensions like Claude Code CLI (#2382) 2026-03-24 15:50:12 -06:00
package-manager.ts merge: resolve conflicts with origin/main for PR #2008 2026-03-25 22:36:37 -06:00
prompt-templates.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00
resolve-config-value.test.ts refactor(test): consolidate regression and override tests into #666 test files 2026-04-02 14:06:19 +02:00
resolve-config-value.ts fix(security): add configurable overrides for command allowlist and SSRF blocklist 2026-04-02 13:45:05 +02:00
resource-loader.ts fix(extensions): use bundledExtensionKeys for conflict detection instead of broken path heuristic (#3305) 2026-04-05 01:04:50 -04:00
retry-handler.test.ts fix(pi-coding-agent): cancel stale retries after model switch 2026-04-03 16:21:21 +02:00
retry-handler.ts fix(pi-coding-agent): cancel stale retries after model switch 2026-04-03 16:21:21 +02:00
sdk.ts fix(pi-coding-agent): resolve model fallback race that ignores configured provider (#3534) 2026-04-05 07:14:24 -05:00
session-manager.test.ts refactor(test): replace try/finally with beforeEach/afterEach in packages tests (#2390) 2026-03-24 21:34:10 -06:00
session-manager.ts Merge pull request #1459 from frizynn/refactor/shared-lock-utils 2026-03-19 15:51:47 -06:00
settings-manager-security.test.ts fix(security): add configurable overrides for command allowlist and SSRF blocklist 2026-04-02 13:45:05 +02:00
settings-manager.ts fix(security): add configurable overrides for command allowlist and SSRF blocklist 2026-04-02 13:45:05 +02:00
skill-tool.test.ts feat(pi): add Skill tool resolution (#1661) 2026-03-20 15:42:28 -06:00
skills.ts fix(skills): prioritize ecosystem dir and skip legacy after migration 2026-03-22 14:11:32 -04:00
slash-commands.ts feat: add /terminal slash command for direct shell execution (#2349) 2026-03-26 09:41:37 -06:00
system-prompt.ts fix: extension resource management — prune stale dirs, fix isBuiltIn, gate skills on Skill tool, suppress search warnings (#2235) 2026-03-23 09:04:01 -06:00
timings.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00