Open
Conversation
Fix two TypeScript compilation errors in claude-agent.ts that blocked the Electron desktop build: - Add intermediate `unknown` cast for BetaRawMessageStreamEvent - Add ImageMediaType alias to satisfy literal union type constraint Disable auto-opening DevTools in detached mode during desktop dev, which was spawning an unwanted separate window on every launch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: TypeScript errors in claude-agent and disable auto DevTools
Adds a new workspace package `@getpaseo/openrouter-agent` — an
ACP-compatible agent bridging Paseo to OpenRouter's chat completions
API. Users install the binary (npm link or publish) and wire it
into `~/.paseo/config.json` as an `extends: "acp"` provider.
packages/openrouter-agent (new workspace):
- ACP agent over stdio JSON-RPC; session lifecycle, tool calls,
permission modes matching Claude Code conventions.
- Streaming with 30s connect / 60s idle timeouts and SSE
parse-error threshold.
- Silent-turn fallback: always emits agent_message_chunk when the
model ends its turn with no content. Surfaces captured
reasoning_content for reasoning models (DeepSeek R1, o1, reasoner).
- Tool-loop guard: early-exit after 5 consecutive content-less
rounds instead of burning the full 25-round budget. Reports tool
call frequency and captured reasoning in the fallback message.
- Tool result size cap (50KB) to prevent context bloat; CLAUDE.md
injection size logged to stderr when > 4KB.
- Human-readable formatting for OpenRouter API errors
(429/401/403/402/404/5xx) with remedy suggestions.
- macOS Keychain fallback for OPENROUTER_API_KEY via the security
CLI (service com.paseo.openrouter-agent, account default). No
shell invocation (execFileSync), no GUI prompts from daemon.
- Hardened .gitignore denies .env*, certs/keys, secrets files.
packages/server:
- provider-launch-config.ts: add optional waitForInitialCommands
and initialCommandsWaitTimeoutMs to the ACP provider override
schema.
- provider-registry.ts, providers/generic-acp-agent.ts: thread
those options through to GenericACPAgentClient so agents that
advertise slash commands asynchronously (openrouter-agent does)
can have the UI wait briefly before showing an empty command list.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new workspace package
@getpaseo/openrouter-agent— an ACP-compatible agent that bridges Paseo to OpenRouter's chat completions API, unlocking 200+ models (Claude, GPT-4o, Gemini, Llama 4, DeepSeek R1, etc.) as Paseo providers. Server-side, threads two new optional ACP provider override fields through the provider registry so agents that advertise slash commands asynchronously get proper UI sequencing.Opened from my fork
benreceveur/paseo— happy to discuss scope, naming, or split this into smaller PRs if that fits your review process better.Motivation
Paseo currently supports Claude Code, Codex, and OpenCode. OpenRouter provides a unified API that routes to hundreds of model providers (many free-tier open-weight models like DeepSeek R1, Llama 4). Adding it as an ACP provider gives users one integration point for the long tail of models without Paseo needing to own each provider SDK individually.
What's in this PR
New package:
packages/openrouter-agent/agent_message_chunkwhen the model ends turn with no content; surfaces capturedreasoning_contentfor reasoning models (DeepSeek R1, o1-class, reasoner)OPENROUTER_API_KEYvia thesecurityCLI (servicecom.paseo.openrouter-agent, accountdefault).execFileSyncavoids shell-injection risk;-wprints only the secret; no-gflag means no GUI prompts from the daemon subprocess.gitignoredenies.env*,*.pem/*.key/*.p12,secrets.json,credentials.json, logs, editor directoriesServer wiring:
packages/server/src/server/agent/provider-launch-config.ts— adds optionalwaitForInitialCommandsandinitialCommandsWaitTimeoutMsto the ACP provider override schemaprovider-registry.ts,providers/generic-acp-agent.ts— thread those options through toGenericACPAgentClientso agents that advertise slash commands asynchronously (openrouter-agent does during skill scan) can have the UI wait briefly before showing an empty command listThese changes are additive and opt-in — existing providers (Claude Code, Codex, OpenCode) are unaffected; the new fields are optional.
Config example
Seeding the key into macOS Keychain (recommended — avoids plain-text key on disk):
Design notes / open questions
secret-tool) and Windows (Credential Manager via PowerShell) if you'd like — held off to keep this PR focused.0.1.56to align with the monorepo sync script. Not added torelease:publishyet — maintainer's call whether this should be on npm or remain internal/source-only.Test plan
npm run typecheck --workspace=@getpaseo/openrouter-agent— passesnpm run build --workspace=@getpaseo/openrouter-agent— builds cleannpm run typecheck --workspace=@getpaseo/server— passes with provider changesnpm run format— clean after auto-format (Biome)OPENROUTER_API_KEYunset in env — reads from keychain, logsusing API key from macOS Keychain...todaemon.log🤖 Generated with Claude Code