Add stream --llm-interval throttle and fix show-code LLM-chain parity#45
Conversation
Bake the --llm-interval cadence into the live `stream --llm` loop and its generated `--show-code` script: refresh the prompt chain at most once per interval (0 = every turn) with a closing flush so tail turns aren't lost. Also fix `transcribe --show-code` chained prompts to wrap follow-up steps under the same "Transcript:" label the CLI's run_chain_steps uses, so the generated script matches a real run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| llm_interval: float = typer.Option( | ||
| 30.0, |
There was a problem hiding this comment.
Default llm_interval=30.0 conflicts with nearby --llm descriptions claiming refresh on every finalized turn, so behavior and command semantics diverge.
| llm_interval: float = typer.Option( | |
| 30.0, | |
| llm_interval: float = typer.Option( | |
| 0.0, |
Details
✨ AI Reasoning
1) The code adds a new interval-based throttle with a nonzero default, so refreshes are no longer guaranteed per finalized turn.
2) Existing user-facing wording in the same command path still describes per-turn refresh behavior.
3) This creates contradictory runtime assumptions for users and generated expectations.
4) The contradiction is concrete and introduced by this change set, not speculative.
Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
Summary
Two related changes to the
--llm/--show-codepaths:stream --llm-intervalis now baked into both the live streaming loop and the generated--show-codescript. The prompt chain refreshes at most once per--llm-intervalseconds (0= every finalized turn), with a closing flush on stop so tail turns aren't dropped. The generatedsummarize()mirrorsStreamSession._maybe_summarize(LLM_INTERVALthrottle +final=Trueflush).transcribe --show-codechain parity: chained--llmfollow-up prompts now wrap the previous result under the sameTranscript:\nlabel that the real CLI uses (llm.run_chain_steps→transform_transcript(transcript_text=output)). Previously the generated script sentprompt + "\n\n" + result, drifting from an actual run for 2+ prompts. Single-prompt output was already identical.Test plan
uv run pytest tests/test_code_gen.py tests/test_stream_llm.py tests/test_stream_session.py— green.aai transcribe --sample --llm … --llm … --show-codenow emits the labeledTranscript:\nform;aai stream --llm … --llm-interval 5 --show-codeemitsLLM_INTERVAL = 5.0with the throttle + closing flush../scripts/check.shgate before merge.🤖 Generated with Claude Code