feat(server): add Claude Code auto mode#751
Open
yuruiz wants to merge 2 commits intogetpaseo:mainfrom
Open
Conversation
…o#741) On macOS unlock after extended display sleep, every mounted AgentPanel would simultaneously revalidate its timeline, saturating the renderer's JS main thread and freezing the UI to mouse and keyboard input. - Coalesce repeated onAppResumed signals (visibilitychange + AppState). - Make bumpHistorySyncGeneration consumers lazy: defer ensureAgentIsInitialized until the panel becomes user-visible. - Only bump generation on WS reconnect when offline duration exceeded HISTORY_STALE_AFTER_MS. - Cancel rAF chains in use-bottom-anchor-controller and web-focus when the document becomes hidden, so they don't accumulate while the renderer is occluded. Fixes getpaseo#741 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Expose Anthropic's classifier-driven auto permission tier as a selectable
mode for Claude agents. Refuses upfront when the agent env routes through
Bedrock or Vertex, since auto mode is Anthropic-API-only.
- Bump @anthropic-ai/claude-agent-sdk 0.2.71 -> 0.2.128 ('auto' lands in
the public PermissionMode union from 0.2.91)
- Pin @modelcontextprotocol/sdk to 1.27.1 — 1.29.0 has a zod 4 type
regression (ZodNumber not assignable to AnySchema, deep instantiation)
- Widen zod range to ^3.23.8 || ^4.0.0 to match the resolved 4.3.6
- Rename internal TurnState literal "autonomous" -> "background" so logs
and types don't collide with Anthropic's auto permission tier
- Drop an @ts-expect-error directive that's no longer needed after the
SDK type updates
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d027a9a to
0b2a145
Compare
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
autopermission tier as a selectable Claude mode (CLI v2.1.83+, SDK v0.2.91+).autoupfront when the agent env routes through Bedrock or Vertex, since auto mode is Anthropic-API-only.TurnStateliteral\"autonomous\"->\"background\"so logs and types don't collide with Anthropic's new auto permission tier (paseo's wake-up turn vocabulary is unrelated to permission tiers).Closes #747 (Phase 1 MVP + Phase 2 full UX). Phase 3 (autoMode.allow / soft_deny editing, PreToolUse "defer", PermissionDenied hook plumbing) intentionally deferred.
Changes
packages/server/package.json@anthropic-ai/claude-agent-sdkto^0.2.91, pin@modelcontextprotocol/sdkto1.27.1, widenzodrange to^3.23.8 || ^4.0.0packages/app/package.json,packages/desktop/package.jsonzodrange to match serverpackages/server/src/server/agent/provider-manifest.tsautoentry toCLAUDE_MODESbetweenacceptEditsandplanpackages/server/src/server/agent/providers/claude-agent.tsautotoDEFAULT_MODES; eligibility check rejectsautowhenCLAUDE_CODE_USE_BEDROCK/CLAUDE_CODE_USE_VERTEXis set in launch env or process env; renameTurnStateliteral\"autonomous\"->\"background\"; drop a now-redundant@ts-expect-errorpackages/server/src/server/agent/providers/claude-agent.redesign.test.ts,packages/server/src/server/agent/create-agent-mode.test.tsWhy pin
@modelcontextprotocol/sdkto 1.27.1?@modelcontextprotocol/sdk@1.29.0has a TypeScript regression with zod 4 schemas:mcp-server.tscalls fail to typecheck (ZodNumber not assignable to AnySchema,Type instantiation is excessively deep and possibly infinite) ontsgo. Pre-existing baseline (1.27.1, claude-agent-sdk 0.2.71) typechecks clean. Pinning is the minimum-risk path to shipautomode without dragging in the regression. Worth filing upstream — happy to do that as a follow-up if useful.Why widen the zod range instead of bumping to ^4?
The resolved
node_modules/zodwas already 4.3.6 before this PR (transitively required byai,openai,@agentclientprotocol/sdk, etc.).claude-agent-sdk@0.2.91+haspeerDependencies.zod: ^4.0.0, which conflicted with the declared^3.23.8. Widening the range to^3.23.8 \|\| ^4.0.0matches the runtime reality without forcing every workspace through a zod 4 migration.Eligibility-check semantics
setMode(\"auto\")callsdetectIneligibleAutoModeTransport(this.launchEnv):process.env, so an explicit\"0\"disables the inherited setting.\"1\",\"true\", etc.) trigger the refusal.set_agent_mode_responsechannel asaccepted: false+error: \"...\", which mobile/CLI already render.This intentionally does not gate on plan tier or model — those are SDK-side checks. The Bedrock/Vertex case is a hard incompatibility that paseo can detect locally without extra infrastructure.
Test plan
npm run typecheck(passes — pre-commit hook)npm run lint(passes)npm run format:check(passes)automode, verify classifier-driven approvals workCLAUDE_CODE_USE_BEDROCK=1in agent env, attempt to switch toauto, verify the friendly refusal messageautooption correctly (it's data-driven viaavailableModes, no app code changes were needed)Out of scope (Phase 3 — separate follow-ups)
autoMode.allow/autoMode.soft_denyper-agent configuration UIPreToolUse\"defer\"decision support in paseo's permission policy layerPermissionDeniedhook plumbing as a first-class WebSocket eventautoMode.environmentauto-population based on agent context (worktree, scheduled run, voice session, etc.)