Add Claude/Codex agents support with WebSocket transport#13
Add Claude/Codex agents support with WebSocket transport#13axeldelafosse merged 4 commits intomainfrom
Conversation
…ignal parsing - Add Claude as a first-class agent via claude-sdk-server using the SDK stream-json protocol over WebSocket, with a relay server for frontend observers - Switch codex app-server from stdin/stdout pipes to WebSocket transport with dynamic port allocation via --listen flag - Add minimal raw TCP WebSocket client (ws-client) to work around Bun's built-in WS client incompatibility with codex app-server - Add port utility (ports.ts) with isPortTaken/findFreePort helpers - Rewrite review signal parsing to require signals on the final non-empty line, detect mixed/malformed/trailing signals, and produce deterministic error messages - Simplify main loop: always error on non-zero exit codes, cleaner follow-up formatting, proper readline cleanup - Pass model through to codex thread creation - Add failureCount to ReviewResult for better follow-up formatting
Summary of ChangesHello @axeldelafosse, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the agent interaction framework by integrating Claude as a new agent type and migrating the Codex app-server to a more robust WebSocket-based communication. These changes improve real-time feedback, streamline agent-to-system communication, and introduce stricter parsing rules for review outcomes, leading to a more reliable and extensible system for automated development workflows. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This is a substantial pull request that introduces significant architectural improvements, most notably adding Claude agent support with a WebSocket transport and migrating the existing codex agent to use WebSockets as well. The strict new parsing for review signals is a fantastic change that will improve robustness. The simplification of the main loop and addition of port utilities are also great quality-of-life improvements. My review focuses on a few areas in the new code, including potential race conditions, dead code, and opportunities to improve the robustness of the new networking clients.
… code - codex-app-server: replace stdout processing in consumeFrames with a simple drain, since all JSON-RPC communication now goes through WebSocket - utils: remove unused normalizeReviewDecision and all related helpers (ReviewDecisionLike, APPROVED_STATUSES, REQUEST_CHANGES_STATUSES, parseStatusValue, parseStatusFromRecord, isObject, ReviewDecision)
Summary
claude-sdk-server.tscommunicates with Claude via the SDKstream-jsonprotocol over WebSocket. Includes a Bun-based relay server that frontend observers can connect to via/wsfor real-time session monitoring.--listenflag). Adds a minimal raw TCP WebSocket client (ws-client.ts) to work around Bun's built-in WS client incompatibility with codex app-server.failureCountonReviewResult. Properreadlinecleanup viafinallyblock.findFreePortandisPortTakenhelpers inports.tsused by both codex and claude server clients.null.Test plan
bun run checkpasses (lint, types, formatting)--agent codexto verify WebSocket transport--agent claudeto verify SDK integration