Skip to content

Fix three command failures in Claude Code sandbox#11

Merged
JohanLorenzo merged 3 commits into
mozilla:mainfrom
JohanLorenzo:sandbox-fixes
May 25, 2026
Merged

Fix three command failures in Claude Code sandbox#11
JohanLorenzo merged 3 commits into
mozilla:mainfrom
JohanLorenzo:sandbox-fixes

Conversation

@JohanLorenzo

@JohanLorenzo JohanLorenzo commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • init: The original flow ran pre-commit install before git commit --amend, so the amend fired the newly installed hooks (which tried to install sqlfluff via pip and failed with SSLCertVerificationError in the sandbox). Fix: move pre-commit autoupdate to before the initial commit so the updated config is included in that commit, then run pre-commit install only after all commits are done. The initial commit has no hooks installed; the amend is eliminated entirely. Also clear GIT_DIR/GIT_INDEX_FILE env vars inherited from a parent worktree, which caused git subprocesses during tests to operate on the wrong repo.
  • update: Pre-check ~/.cargo/ writability before invoking cargo. Replaces raw "Operation not permitted (os error 1)" with a single actionable message pointing the user outside the sandbox.
  • execute --interactive: Detect no-TTY via std::io::IsTerminal. When --interactive is requested without a terminal: use the parameter's declared default value if one exists; otherwise bail with an explicit --param name=<value> hint instead of crashing with IO error: not a terminal.

Verification

498bc5d — Reorder init to eliminate git commit --amend and clear git env vars

Before:

Error: git commit --amend failed: ... SSLError(SSLCertVerificationError('OSStatus -26276'))

After:

⚙ Setting up pre-commit...
  ⚠ pre-commit autoupdate failed, using template versions
⚙ Initializing git repository...
⚙ Creating initial commit...
  ✓ Initial commit created
⚙ Installing pre-commit hooks...
  ✓ Installed pre-commit git hooks
✓ Repository scaffolded successfully
exit: 0

458ac1a — Detect ~/.cargo/ write restriction in update command

Before:

ERROR Fatal error:
  × failed to parse binstall crates-v1 manifest: I/O Error: Operation not permitted (os error 1)
cargo binstall not available, falling back to cargo install
error: failed to open: /Users/.../.cargo/.crates.toml
Caused by: Operation not permitted (os error 1)
Error: cargo install stmo-cli failed
exit: 1

After:

Error: Cannot update stmo-cli in the current environment (write access to ~/.cargo/ is restricted).
Run this command outside the sandbox:
  cargo binstall stmo-cli
exit: 1

34257a7 — Fall back to defaults in execute --interactive when no TTY

Before (any parameterized query):

Error: IO error: not a terminal
exit: 1

After (param has no default):

Error: No TTY available for interactive prompt. Supply parameter explicitly: --param my_param=<value>
exit: 1

After (param has a default):

Parameters:
  my_param = "default_val"
[proceeds to execute query]
exit: 0

@JohanLorenzo JohanLorenzo marked this pull request as ready for review May 25, 2026 09:24
@JohanLorenzo JohanLorenzo merged commit efb4592 into mozilla:main May 25, 2026
6 checks passed
@JohanLorenzo JohanLorenzo deleted the sandbox-fixes branch May 25, 2026 09:24
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.

1 participant