Open
Conversation
7c24a00 to
a9e4936
Compare
cbc46a9 to
1eb0721
Compare
Add SessionMode (Terminal/Structured), StructuredProcess module for managing claude CLI in stream-json mode, mode switch endpoint (POST /sessions/:id/mode), and prompt endpoint (POST /sessions/:id/prompt) that collects JSON events.
…ocol - TypesSpec: 19 tests (SessionMode JSON, PromptRequest, ModeRequest, Session JSON with mode/claudeId fields) - StructuredSpec: 14 tests (encodeUserMessage format, parseInitSessionId, isResultEvent detection) - Fix ApiSpec for IO Application change
Skip Terminal relay test which needs a running tmux server.
- 4 integration tests: spawn/init, prompt/result, non-empty response, resume conversation history - CI splits into: unit tests (always), integration (claude-tests env) - Environment approval required before running claude API calls
- 4 integration tests: spawn/init, prompt/result, non-empty response, resume conversation history - CI splits into: unit tests (always), integration (claude-tests env) - Fixed stream-json init handshake: send control_request, wait for control_response, capture session_id from hook events - PATH includes /run/current-system/sw/bin for claude CLI
1eb0721 to
512522e
Compare
- readInitEvent skips to control_response (no hooks on runner) - Resume test gracefully skips when session_id unavailable - Remove stm test dependency (unused after refactor)
Runner overrides HOME to a temp dir, so claude can't find credentials or session files for --resume. Export HOME=/home/paolino in the integration test step.
The github-runner DynamicUser has no persistent HOME or claude credentials. Basic prompts work (3 tests), but --resume needs session files that claude writes to $HOME/.claude/ which doesn't exist for the runner.
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
SessionModetype (Terminal/Structured) with mode field on all sessionsAgentDaemon.Structuredmodule manages claude CLI in stream-json mode via typed-processPOST /sessions/:id/modeswitches between terminal and structured mode with--resumePOST /sessions/:id/promptsends prompts to structured sessions, returns JSON events--dangerously-skip-permissionsbypasses permission prompts in structured modeTest plan
Tested manually against a live daemon (
--port 18080 --base-dir /code):POST /sessions/:id/mode {"mode":"structured"}switches mode, captures claude session UUIDGET /sessionsshowsmodefield on all sessionsPOST /sessions/:id/promptreturns JSON events (system, assistant, result)"session must be in structured mode")"already in mode")DELETE /sessions/:idcleans up structured processCloses #52