Skip to content

Handle --sandbox and --env conflicts with precedence warning#90

Merged
alexkroman merged 2 commits into
mainfrom
claude/beautiful-cori-lpb5dv
Jun 12, 2026
Merged

Handle --sandbox and --env conflicts with precedence warning#90
alexkroman merged 2 commits into
mainfrom
claude/beautiful-cori-lpb5dv

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Summary

Add conflict detection and user-friendly warnings when --sandbox and --env flags are passed together with conflicting values. Since credentials are environment-bound, --env takes precedence and --sandbox is ignored, but users need to know this happened.

Key Changes

  • New conflict detection (_sandbox_conflict_warning in main.py): Detects when --sandbox and a non-sandbox --env are both specified, returning a warning message that names the ignored flag
  • Warning emission: Integrated into the main CLI flow to emit the conflict warning (unless --quiet is set), supporting both human-readable and JSON output modes
  • Test coverage: Added comprehensive tests for:
    • Conflicting flags produce a warning in normal mode
    • Agreeing flags (--sandbox --env sandbox000) produce no warning
    • --quiet suppresses the warning
    • JSON mode renders the warning as {"warning": "…"} for machine-readable pipelines
  • Documentation improvements: Updated speak command help text and examples to clarify that --sandbox is a root-level flag (goes before the subcommand), not a subcommand option
  • Bug fix: Fixed transcribe_batch.expand_sources to reject empty string sources (e.g., from unset shell variables) instead of treating them as the current directory

Implementation Details

  • The conflict warning is computed early in main() before environment resolution, then emitted alongside the existing env_override_warning in a unified loop
  • Both warnings respect the --quiet flag and json_mode setting for consistent behavior
  • Updated all speak command examples and error messages to use the correct syntax: assembly --sandbox speak … rather than assembly speak … --sandbox
  • The empty-string source fix uses not source instead of source is None to catch both cases, preventing accidental batch-transcription of the working directory

https://claude.ai/code/session_01CjW9fAmrMbxMs4QhXSwVVR

claude added 2 commits June 12, 2026 00:47
Three error-path fixes found by exploratory QA:

- `assembly transcribe ""` no longer batch-transcribes the working
  directory: Path("") is Path("."), so an empty source (e.g. an unset
  shell variable) fell into the directory branch and uploaded every
  audio file under cwd. It now fails like a missing source.
- `--sandbox` combined with a contradictory `--env` now warns instead
  of being silently ignored; --env still wins. Credentials are
  environment-bound, so the conflict must not resolve invisibly.
- `assembly speak` in production now suggests the working command
  ('assembly --sandbox speak …'); the old hint and the epilog examples
  put --sandbox after the subcommand, where it fails with
  "No such option" (it's a root-only flag).

https://claude.ai/code/session_01CjW9fAmrMbxMs4QhXSwVVR
@alexkroman alexkroman enabled auto-merge (squash) June 12, 2026 01:18
@alexkroman alexkroman merged commit b79785d into main Jun 12, 2026
8 checks passed
@alexkroman alexkroman deleted the claude/beautiful-cori-lpb5dv branch June 12, 2026 01:22
alexkroman pushed a commit that referenced this pull request Jun 12, 2026
…into the QA-fix branch

Main's #90 fixed two of the same QA findings differently: adopt its
--sandbox/--env conflict warning (--env wins, surfaced as {"warning": …}
in JSON mode) over this branch's hard usage error, and keep this
branch's fuller speak sandbox-hint suggestion which subsumes main's.

https://claude.ai/code/session_01LkB3yQbPDG7Ex4mNL3Wtb6
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