Repository navigation
Default to claude and stream its answers live - #79
Merged
Merged
Conversation
- claude is first in LACY_TOOL_LIST (auto-detect order) and marked recommended. With no tool installed, install.sh and `lacy setup` offer Claude Code instead of lash; lash's free tier refuses `lash run`, so it cannot answer out of the box. `lacy doctor` points to claude / lacy setup. - claude answers stream: with python3, Lacy runs claude with --output-format stream-json --include-partial-messages and lib/core/claude_stream.py prints text chunks as they arrive, stops the spinner at the first one, and hands the final result event back, so --resume, the resume retry, error framing, and Ctrl+C handling are unchanged. Without python3 it waits for --output-format json as before. Streamed text is printed raw (no markdown renderer), like other CLIs. Measured in a pty with "count from 1 to 300": 50 at 5.2s, 100 at 6.1s, 200 at 7.2s, 300 at 8.5s (before: everything at the end).
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.
Claude is now Lacy's default tool, and its answers stream as they're written.
Streaming
Lacy runs
claude -pwith--output-format stream-json --include-partial-messages. A small filter (lib/core/claude_stream.py) prints each text chunk as it arrives, stops the spinner at the first chunk, and hands claude's finalresultevent back to the existing code. So--resume, the resume retry, error framing and Ctrl+C handling are unchanged. Without python3, Lacy falls back to today's wait-for-JSON behavior.Measured in a pty with "count from 1 to 300":
Trade-off: streamed text is printed raw, not through glow or the basic markdown renderer.
Default tool
install.shandlacy setupoffer to install Claude Code instead of lash. lash's free tier refuseslash run, so it can't answer out of the box.lacy doctorpoints to claude orlacy setup.Tests
test_runtimegets a streaming section with a fake claude emitting stream-json. It checks that text is shown exactly once, the session is captured, the flags are passed, an error result with no text is still reported, and Ctrl+C isn't retried. 10 new assertions, run in bash and zsh.script/test.shpasses locally, 21/21, including the live suite (claude and codex PASS in both shells).