Skip to content

Fix code-review findings: JSON list output, agent/TTS robustness, auth-flow structure#62

Merged
alexkroman merged 2 commits into
mainfrom
claude/upbeat-shannon-seye5z
Jun 11, 2026
Merged

Fix code-review findings: JSON list output, agent/TTS robustness, auth-flow structure#62
alexkroman merged 2 commits into
mainfrom
claude/upbeat-shannon-seye5z

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Correctness:

  • aai agent --list-voices and aai llm --list-models now route through
    run_command, so --json emits a machine-readable array instead of plain text.
  • File-driven agent runs fail loudly (APIError) when the session-ready wait
    times out, instead of silently consuming and dropping the clip's audio.
  • Malformed TTS Audio frames (missing or undecodable payload) map to a clear
    APIError; base64 is now strictly validated so junk bytes can't corrupt PCM.

Structure:

  • New aai_cli/ws.py deduplicates the WebSocket auth-error classification and
    websockets logger silencing that agent/session.py and tts/session.py carried
    as identical copies.
  • NotAuthenticated gains a structured rejected_key flag; auto-login suppression
    keys off it instead of matching error message text.
  • login/logout opt out of auto-login at their run_command call sites
    (auto_login=False) instead of a hardcoded command-name set in context.py.
  • TTS PCM duration formula extracted into one helper.

https://claude.ai/code/session_01RriYLpxVebHxots7yyPUo3

claude added 2 commits June 11, 2026 14:23
…h-flow structure

Correctness:
- aai agent --list-voices and aai llm --list-models now route through
  run_command, so --json emits a machine-readable array instead of plain text.
- File-driven agent runs fail loudly (APIError) when the session-ready wait
  times out, instead of silently consuming and dropping the clip's audio.
- Malformed TTS Audio frames (missing or undecodable payload) map to a clear
  APIError; base64 is now strictly validated so junk bytes can't corrupt PCM.

Structure:
- New aai_cli/ws.py deduplicates the WebSocket auth-error classification and
  websockets logger silencing that agent/session.py and tts/session.py carried
  as identical copies.
- NotAuthenticated gains a structured rejected_key flag; auto-login suppression
  keys off it instead of matching error message text.
- login/logout opt out of auto-login at their run_command call sites
  (auto_login=False) instead of a hardcoded command-name set in context.py.
- TTS PCM duration formula extracted into one helper.

https://claude.ai/code/session_01RriYLpxVebHxots7yyPUo3
Security review follow-up: a session.error with UNAUTHORIZED/FORBIDDEN means a
credential was presented and refused, so it must carry rejected_key=True —
otherwise an interactive `aai agent` run with a bad ASSEMBLYAI_API_KEY would
trigger a browser auto-login that cannot fix the failure (the env key still
wins on rerun) and clobbers the profile's stored key.

https://claude.ai/code/session_01RriYLpxVebHxots7yyPUo3
@alexkroman alexkroman merged commit e2bef7e into main Jun 11, 2026
11 checks passed
@alexkroman alexkroman deleted the claude/upbeat-shannon-seye5z branch June 11, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants