Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions packages/providers/src/community/pi/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@ export class PiProvider implements IAgentProvider {
// the file directly (api_key entries) is picked up transparently.
//
// Per-request env vars override the file via setRuntimeApiKey — this
// mirrors Claude's `{...subprocessEnv, ...requestOptions.env}` pattern
// at packages/providers/src/claude/provider.ts:889-890 and ensures
// codebase-scoped env vars (from .archon/config.yaml `env:`) win over
// the user's global Pi login.
// mirrors Claude's process-env + request-env merge pattern and
// ensures codebase-scoped env vars (from .archon/config.yaml `env:`)
// win over the user's global Pi login.
//
// Pi's internal resolution order (auth-storage.ts:424-485):
// Pi's internal resolution order:
// 1. runtime override (our setRuntimeApiKey below)
// 2. auth.json api_key entry
// 3. auth.json oauth entry (auto-refreshes expired tokens)
Expand Down Expand Up @@ -200,8 +199,8 @@ export class PiProvider implements IAgentProvider {
// returns a SessionManager bound to either a new session (no resume
// id) or an existing session (resume id matches a file); if the id
// was provided but not found, it falls through to a new session and
// the caller surfaces a resume_failed warning (matches Codex pattern
// at packages/providers/src/codex/provider.ts:553-558).
// the caller surfaces a resume_failed warning (matches the Codex
// provider's fallback pattern for the same condition).
const { sessionManager, resumeFailed } = await resolvePiSession(cwd, resumeSessionId);
if (resumeFailed) {
yield {
Expand Down
4 changes: 2 additions & 2 deletions packages/providers/src/community/pi/session-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export interface ResolvedSession {
/**
* True when a resumeSessionId was provided but no matching session file
* was found — caller should surface a system warning before the new
* session starts (mirrors Codex's resume_thread_failed fallback at
* packages/providers/src/codex/provider.ts:553-558).
* session starts. Mirrors the `resume_thread_failed` fallback pattern
* the Codex provider uses.
*/
resumeFailed: boolean;
}
Expand Down
Loading