Commit Graph

2 Commits

Author SHA1 Message Date
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
Dimitar Ganev af50d3bfa4 fix(ai): retry GitHub Copilot transient model_not_supported 400s
GitHub Copilot intermittently returns `HTTP 400 model_not_supported`
for preview models (gpt-5.3-codex, gpt-5.4, gpt-5.4-mini, ...) on OAuth
clients other than VS Code, even when `/models` reports the model as
enabled. Root cause is a per-OAuth-client rollout gap across Copilot's
responses backend; repeating the identical request typically lands on
a backend that has the model. See opencode#13313.

- Add `isCopilotTransientModelError` and `callWithCopilotModelRetry`
  in `utils/retry` (3 attempts, linear backoff, abort-aware, no-op
  for non-Copilot providers).
- Wrap `client.responses.create` in `openai-responses` and the
  initial completions stream in `openai-completions` with the retry.
- Extend Anthropic `isProviderRetryableError` to treat Copilot
  transient model errors as provider-retryable.
- Rename `rewriteCopilotAuthError` to `rewriteCopilotError` and add
  a 400 `model_not_supported` rewrite surfacing actionable guidance
  (retry, switch to a GA model, or run from VS Code) after retries
  exhaust.
- Rename test file accordingly and add a dedicated retry unit test.
2026-04-18 22:32:51 +02:00