Skip to content

add support for compatible custom tools (compatible_with)#550

Open
johnrichardrinehart wants to merge 2 commits intoasheshgoplani:mainfrom
johnrichardrinehart:fix/compatible-with-tool-overrides
Open

add support for compatible custom tools (compatible_with)#550
johnrichardrinehart wants to merge 2 commits intoasheshgoplani:mainfrom
johnrichardrinehart:fix/compatible-with-tool-overrides

Conversation

@johnrichardrinehart
Copy link
Copy Markdown
Contributor

@johnrichardrinehart johnrichardrinehart commented Apr 9, 2026

Summary

  • add support for compatible custom tools via a new compatible_with setting
  • preserve the configured custom tool identity instead of rewriting wrapper tools to built-in names during tmux detection
  • route Codex compatibility paths through the configured wrapper command so restart, resume, parsing, hooks, and session tracking keep using the custom tool

Example configuration

[tools.my-codex]
command = "my-codex"
compatible_with = "codex"
icon = "💻"

This lets my-codex behave like Codex for agent-deck feature handling while still preserving the custom tool name and command.

Example wrapper script

#!/usr/bin/env bash
set -euo pipefail

export OPENAI_API_KEY="${OPENAI_API_KEY:?missing OPENAI_API_KEY}"
exec codex "$@"

For example, save that as ~/bin/my-codex, make it executable, and then point the tool config at my-codex.

Testing

  • go test ./...
  • manual validation with a custom wrapper configured as compatible_with = "codex"
  • confirmed that restart/resume continues to use the wrapper command rather than falling back to plain codex
  • confirmed that the custom tool identity is preserved instead of being rewritten to the built-in tool name

Notes

  • this has been tested with compatible_with = "codex" and it is working great
  • this branch is currently stacked on top of fix(test): stabilize tmux-backed test suites #551, which contains the test-suite stabilization changes used while validating this work

Several test packages were reading the developer's real ~/.agent-deck state,
reusing fixed tmux fixture names, and assuming classic shell prompts and a
single quit path. That made go test ./... fail nondeterministically depending
on local config, shell theme, and leftover tmux sessions.

This change gives the tmux/session/integration/UI/TUI tests a temporary HOME,
restores shell-friendly non-sandbox startup, broadens shell prompt detection,
uses unique control-pipe fixture sessions, and makes the smoke tests tolerant
of confirmation and remain-on-exit behavior.

Constraint: tmux-backed tests must remain runnable on machines with custom prompts and existing ~/.agent-deck state
Rejected: Skip the tmux smoke/integration tests by default | would hide real regressions in the main test path
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: Keep package TestMain isolation in place for any test suite that touches tmux, HOME, or ~/.agent-deck state
Tested: go test ./... in the working tree with the same test-fix diff applied; focused reruns for internal/tmux, internal/session, internal/integration, internal/ui, and internal/tuitest
Not-tested: clean-worktree full go test ./... under disk-full conditions (verification there hit no-space errors unrelated to code)
Keep configured custom tool names during tmux-based tool detection instead of rewriting them to built-in tool names. This fixes restart and resume flows where a custom wrapper such as my-codex could be persisted as codex and later resumed with the wrong executable.

Introduce a generic compatible_with tool setting and use it in both Claude and Codex compatibility checks. This keeps the exact executable-name fallback for built-ins while giving wrapper commands an explicit, upstream-friendly opt-in path.

Route Codex-specific restart, readiness, response parsing, hook handling, and session tracking through IsCodexCompatible, and build Codex resume commands from the configured command for compatible wrappers. That preserves wrapper execution on restart instead of hard-coding plain codex.

Add regression coverage for compatible custom tools and wrapper commands without relying on machine-specific paths or out-of-tree scripts.
@johnrichardrinehart johnrichardrinehart force-pushed the fix/compatible-with-tool-overrides branch from b40cc22 to a541040 Compare April 9, 2026 02:02
@johnrichardrinehart
Copy link
Copy Markdown
Contributor Author

This branch is now rebased on top of #551. GitHub cannot set a PR base to a fork-only branch, so #550 still targets main, but reviewers should treat #551 as the prerequisite lower PR in the stack.

@johnrichardrinehart johnrichardrinehart changed the title fix(session): preserve custom tool identity for compatible wrappers add support for compatible custom tools (compatible_with) Apr 9, 2026
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