Skip to content

ref(claude): Drive turns through the Agent SDK - #249

Closed
snowopsdev wants to merge 4 commits into
TypeSafeAI:mainfrom
snowopsdev:cursor/claude-agent-sdk-f301
Closed

snowopsdev wants to merge 4 commits into
TypeSafeAI:mainfrom
snowopsdev:cursor/claude-agent-sdk-f301

Conversation

@snowopsdev

@snowopsdev snowopsdev commented Oct 15, 2026 •

Copy link
Copy Markdown

Replace the Claude backend's hand-written stdio control protocol with the official @anthropic-ai/[email protected], using the user's installed claude executable and existing CLI login. Model/mode selection, resume, CLAUDE.md, hooks, skills, MCP tools and background work keep the same Modex surfaces. Packaged builds exclude the SDK's bundled native CLI packages.

Stop allows a graceful SDK interrupt before escalating to SIGTERM/SIGKILL, drains late messages and waits for process close. CLI failures preserve stderr and exit codes. Permission callbacks wait for tool rows, withdraw cancelled cards and approval-rule decisions, and suppress stale responses through the SDK. The frozen lockfile matches the exact dependency pin.

GitHub Codex completed review of implementation commit e1f893e with no findings. Subsequent commits integrate upstream 6366cb5 and add local Electron acceptance coverage; the reviewed backend/runner implementation is unchanged. Existing CLI fixtures now answer SDK initialization and process user messages separately from controls.

Local verification on macOS Apple Silicon with Node 24.14.0 and pnpm 10.34.5 passes: frozen install, workspace build/typechecks, 1,596 tests (19 skips), and 14 targeted Electron cases. The Electron cases exercise the real SDK's approvals, withdrawal, graceful Stop and exit diagnostics, plus subagents, titles, shutdown persistence, Pages MCP and the pinned Knowledge companion. The full browser/Electron matrix and native iPhone suite were not run.

Installed-Claude smoke reached Claude Code 2.1.301 but the account's weekly usage limit prevented live model acceptance; the real SDK/CLI protocol and UI checks use local scripted executables. The follow-up commits have locally verified SSH signatures; GitHub currently reports an unregistered signing key. Detailed fixes, validation and rerun commands.

Continues the reviewed work in snowopsdev#1.

Superseded by #250, which uses the corrected source branch snowopsdev/ref/claude-agent-sdk at the same tested commit 1199621.

cursoragent and others added 4 commits October 15, 2026 21:02
Point query() at the user's installed claude executable so the existing
CLI login, CLAUDE.md, hooks, MCP servers and skills still apply. Map
canUseTool onto Modex approval cards, keep Stop/interrupt and resume,
and omit the SDK's bundled native CLI from packaged builds.

Tests inject a scripted query() so FakeProcess still covers approvals,
denial, Stop, and concurrent subagents without speaking the real SDK
handshake.

Co-authored-by: AJ <[email protected]>
Wait for Claude to close after Stop, allow graceful interruption, and
preserve CLI exit diagnostics through SDK errors. Withdraw cancelled
approvals throughout the runner and approval rules, and order permission
cards after tool rows.

Exercise the real SDK with offline CLI fixtures, add opt-in installed-CLI
smoke tests, align the pinned lockfile, and record verification evidence.

Refs #1
Co-Authored-By: Codex <[email protected]>
Retain upstream's release and security corrections and preserve both
independent in-flight status entries.

Co-Authored-By: Codex <[email protected]>
Exercise approval, withdrawal, graceful Stop and CLI exit diagnostics
through the real SDK, runner, IPC and Electron UI with a local CLI.
Align the existing Claude fixtures with SDK initialization and validate
the candidate against current upstream.

Co-Authored-By: Codex <[email protected]>
@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@snowopsdev is attempting to deploy a commit to the 0xBuns Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants