Skip to content

fix(shell): stub ShellTool pending reubeno/brush#1184#21

Merged
hartsock merged 3 commits into
mainfrom
feat/stub-shell
Jun 9, 2026
Merged

fix(shell): stub ShellTool pending reubeno/brush#1184#21
hartsock merged 3 commits into
mainfrom
feat/stub-shell

Conversation

@hartsock

@hartsock hartsock commented Jun 8, 2026

Copy link
Copy Markdown
Member

What this PR does

Removes all brush git dependencies from the workspace and replaces the real CommandInterceptor-backed shell implementation with a stub that:

  • Preserves the complete argv / free-form JSON schema so MCP clients can introspect the tool interface unchanged.
  • Returns ToolError::Other on every invoke() call with a message explaining the temporary degradation and linking to the tracking PR and issue — nothing is silently missing.
  • Removes caveat_interceptor.rs (preserved in git history; see lib.rs doc comment for restoration procedure).
  • Updates the MCP handler unit tests and the end-to-end stdio integration test (mcp_stdio.rs) to assert stub behaviour instead of real execution or caveats-based denial.

Root cause: crates.io rejects any workspace that contains a git = ... dependency, even an optional one. The brush CommandInterceptor hook that the shell tool requires lives in our fork and cannot be packaged until reubeno/brush#1184 merges and brush ships a new crates.io release.

Test plan

  • cargo test --workspace --exclude agent-bridle-py — all tests pass including the end-to-end leash_holds_through_the_mcp_boundary integration test (updated for stub behaviour)
  • cargo clippy --workspace --exclude agent-bridle-py -- -D warnings — zero warnings
  • cargo fmt --all -- --check — clean

Out of scope

Tracking

🤖 Generated with Claude Code — Beaver (MacBook agent, Claude Sonnet 4.6)

hartsock and others added 2 commits June 7, 2026 21:59
The brush CommandInterceptor hook that backs the shell tool cannot be
packaged as a crates.io dependency until the upstream PR merges. This
commit removes all brush git deps and replaces the real implementation
with a stub that:

- Preserves the complete argv/free-form JSON schema so consumers can
  introspect the tool interface.
- Returns ToolError::Other with a message linking to
  reubeno/brush#1184 and #20 on
  every invoke() call — no functionality is silently missing.
- Updates the MCP handler unit tests and the end-to-end stdio
  integration test to assert the stub behaviour instead of real
  execution or caveats-based denial.
- Deletes caveat_interceptor.rs (preserved in git history; restoration
  procedure in lib.rs doc comment and issues #20 / newt-agent#206).

Unblocks crates.io publish of the whole agent-bridle workspace.

Tracking: #20
Upstream: reubeno/brush#1184

Co-authored-by: Beaver (MacBook agent, Claude Sonnet 4.6) <noreply@anthropic.com>
…5 crates

Now that the brush git dep is removed (feat/stub-shell), all five
crates in the workspace can publish to crates.io. This commit:

- Adds .github/workflows/release.yml: tag-triggered build of the
  agent-bridle-mcp binary (Linux x86_64 + macOS arm64), GitHub release
  creation, and topological crates.io publish for all 5 crates:
  agent-bridle-core → agent-bridle-tool-shell → agent-bridle-tool-web
  → agent-bridle → agent-bridle-mcp.
- Updates the `publish-crates` justfile recipe to match the same crate
  list and order (HOOK PARITY). Previously only agent-bridle-core and
  agent-bridle-tool-web were included.

Requires CARGO_REGISTRY_TOKEN secret under Settings → Secrets.

Co-authored-by: Beaver (MacBook agent, Claude Sonnet 4.6) <noreply@anthropic.com>
PR #21's 'fmt + clippy + test' job failed at rustfmt; after that, clippy
-D warnings also flags doc_lazy_continuation on the stub doc comment.
- cargo fmt --all (handlers.rs over-width assert; shell_tool.rs compressed test impls)
- blank doc line before the trailing 'See <issue>' so it isn't parsed as an
  unindented continuation of the numbered restore-list.
@hartsock hartsock merged commit d130fdd into main Jun 9, 2026
1 check passed
hartsock added a commit to Gilamonster-Foundation/newt-agent that referenced this pull request Jun 9, 2026
…blish (#208)

newt-tui and newt-mcp-server previously depended on agent-bridle via a
pinned git rev (and its transitive brush fork git dep), which blocked
the entire workspace from publishing to crates.io.

Changes:
- Switch `agent-bridle = { git = ... }` to `agent-bridle = "0.1"` in
  newt-tui and newt-mcp-server (registry dep, crates.io safe).
- Add `[patch.crates-io]` in the workspace root pointing to the
  feat/stub-shell branch so CI resolves the dep until agent-bridle
  0.1.0 is indexed on crates.io. Remove the patch block after indexing.
- Update test stubs in newt-mcp-server/src/handlers.rs: three shell
  tests now assert the stub unavailable error instead of real execution
  or caveats denial (same pattern as agent-bridle PR #21).
- Re-enable the `publish-crates` job in release.yml (was `if: false`).
  This unblocks the full 10-crate crates.io publish chain on tag push.

Depends on: Gilamonster-Foundation/agent-bridle#21
Tracking: Gilamonster-Foundation/agent-bridle#20
Tracking: #206

Co-authored-by: hartsock <hartsock@users.noreply.github.com>
Co-authored-by: Beaver (MacBook agent, Claude Sonnet 4.6) <noreply@anthropic.com>
hartsock added a commit to Gilamonster-Foundation/newt-agent that referenced this pull request Jun 27, 2026
…blish (#208)

newt-tui and newt-mcp-server previously depended on agent-bridle via a
pinned git rev (and its transitive brush fork git dep), which blocked
the entire workspace from publishing to crates.io.

Changes:
- Switch `agent-bridle = { git = ... }` to `agent-bridle = "0.1"` in
  newt-tui and newt-mcp-server (registry dep, crates.io safe).
- Add `[patch.crates-io]` in the workspace root pointing to the
  feat/stub-shell branch so CI resolves the dep until agent-bridle
  0.1.0 is indexed on crates.io. Remove the patch block after indexing.
- Update test stubs in newt-mcp-server/src/handlers.rs: three shell
  tests now assert the stub unavailable error instead of real execution
  or caveats denial (same pattern as agent-bridle PR #21).
- Re-enable the `publish-crates` job in release.yml (was `if: false`).
  This unblocks the full 10-crate crates.io publish chain on tag push.

Depends on: Gilamonster-Foundation/agent-bridle#21
Tracking: Gilamonster-Foundation/agent-bridle#20
Tracking: #206

Co-authored-by: hartsock <hartsock@users.noreply.github.com>
Co-authored-by: Beaver (MacBook agent, Claude Sonnet 4.6) <noreply@anthropic.com>
@hartsock hartsock deleted the feat/stub-shell branch July 1, 2026 16:53
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