feat: CLI reads session_id from AGENT_EVENT_BUS_SESSION_ID env var - #95
Conversation
When --session-id is not provided, the CLI now falls back to the AGENT_EVENT_BUS_SESSION_ID environment variable. This allows hooks that set this variable to have their CLI publishes properly attributed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code ReviewSummaryThis PR adds environment variable fallback for Issues FoundCriticalNone ImportantNone Suggestions
VerdictREQUEST_CHANGES - Code is correct and well-tested, but the new environment variable should be documented in CLAUDE.md and CLI help for consistency with existing patterns. Automated review by Claude Code |
- Add env var to CLAUDE.md Operations section - Update CLI --session-id help text to mention env var fallback Addresses claude-review feedback. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Feedback AddressedImplemented
|
Code ReviewSummaryThis PR adds environment variable fallback for Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - Both suggestions from the previous review have been implemented. The code correctly prioritizes explicit Automated review by Claude Code |
Summary
When
--session-idis not provided, the CLI now falls back to theAGENT_EVENT_BUS_SESSION_IDenvironment variable. This allows hooks that set this variable to have their CLI publishes properly attributed instead of showingfrom: anonymous.Changes
cli.py: Add env var fallback for session_id incmd_publish()test_cli.py: Add 2 tests for env var behaviorRelated Settings Updates
Also updated
~/.claude/settings.json(outside this repo):EVENT_BUS_URL→AGENT_EVENT_BUS_URL(correct name)AGENT_SESSION_ANALYTICS_URLTest plan
make checkpasses (263 tests)🤖 Generated with Claude Code