Repository navigation
Drive Claude through the Agent SDK instead of claude -p stream-json - #1
Open
snowopsdev wants to merge 6 commits into
Open
snowopsdev wants to merge 6 commits into
snowopsdev wants to merge 6 commits into
Conversation
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]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
snowopsdev
marked this pull request as draft
October 15, 2026 21:04
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 778844ff0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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]>
snowopsdev
added a commit
that referenced
this pull request
Oct 15, 2026
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]>
snowopsdev
marked this pull request as ready for review
October 15, 2026 21:41
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]>
This was referenced Oct 15, 2026
Record real Electron captures of approval, withdrawal, Stop and CLI failure through the shipped SDK and local executable fixture. Include capture provenance and link the images from the upstream review. Co-Authored-By: Codex <[email protected]>
snowopsdev
force-pushed
the
cursor/claude-agent-sdk-f301
branch
from
October 15, 2026 22:33
1199621 to
e105d4f
Compare
Pass the SDK spawn signal through to the CLI launcher so a deferred launch cannot outlive a stopped turn. Cover cancellation after the Stop grace with the real SDK and a real child process. Refs TypeSafeAI#250 Co-Authored-By: Codex <[email protected]>
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.
Replace the Claude backend's hand-written stdio control protocol with the official
@anthropic-ai/[email protected], using the user's installedclaudeexecutable 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.
Upstream
6366cb5is integrated, and existing CLI fixtures answer SDK initialization and process user messages separately from controls. Codex's upstream follow-up identified a deferred-launch cancellation race. The process factory now forwards the SDK's cancellation signal; a real-SDK regression verifies that a launch attempted after Stop exits withAbortError.Local verification on macOS Apple Silicon with Node 24.14.0 and pnpm 10.34.5 passes: frozen install, workspace build/typechecks, and 1,597 tests (19 skips). The SDK Electron lifecycle case passes again after this fix, exercising approvals, withdrawal, graceful Stop and exit diagnostics. Fourteen targeted Electron cases passed on the earlier candidate, including subagents, titles, shutdown persistence, Pages MCP and the pinned Knowledge companion; the other 13 were not rerun for this follow-up. 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. All commits in this PR are verified by GitHub. The follow-up commits use the registered GPG key
05896A04CA8D92EA. Detailed fixes, validation and rerun commands.Upstream contribution: TypeSafeAI#250.
Signing repair preserved every file, commit message, author and merge parent. Reviewed commit
e1f893emaps to13c6530, and tested implementation1199621maps toe105d4f; their trees are identical.