Server (agent.py):
- _stream_queues: per-session asyncio.Queue for token chunks
- _push_stream_chunk() / _end_stream() helpers
- Medium tier: astream() with <think> block filtering — real token streaming
- Light tier: full reply pushed as single chunk then [DONE]
- Complex tier: full reply pushed after agent completes then [DONE]
- GET /stream/{session_id} SSE endpoint (data: <chunk>\n\n, data: [DONE]\n\n)
- medium_model promoted to module-level global for astream() access
CLI (cli.py):
- stream_reply(): reads /stream/ SSE, renders tokens live with Rich Live (transient)
- Final reply rendered as Markdown after stream completes
- os.getlogin() replaced with os.getenv("USER") for container compatibility
Dockerfile.cli + docker-compose cli service (profiles: tools):
- Run: docker compose --profile tools run --rm -it cli
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
441 B
Markdown
19 lines
441 B
Markdown
# Use Case: CLI Startup
|
|
|
|
Verify the Adolf CLI container starts cleanly, shows the welcome banner,
|
|
and exits without error when the user closes input.
|
|
|
|
## Steps
|
|
|
|
```bash
|
|
echo "" | docker compose --profile tools run --rm -T cli \
|
|
python3 cli.py --url http://deepagents:8000 --session use-case-cli-startup
|
|
echo "exit code: $?"
|
|
```
|
|
|
|
## Pass if
|
|
|
|
- Output contains `Adolf CLI`
|
|
- Output contains the session name and gateway URL
|
|
- Exit code is 0
|