Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/agent/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ func buildOptions(cfg *config.Config, opts Options) ([]claude.Option, error) {
claude.WithMaxTurns(cfg.Agent.MaxTurns),
claude.WithPermissionMode(cfg.Agent.PermissionMode),
claude.WithAllowedTools(allowedToolPattern...),
// Required by recent versions of the claude CLI when combined
// with --print and --output-format=stream-json — without it the
// subprocess exits immediately with "requires --verbose". The
// SDK passes through cfg.Verbose to the subprocess's --verbose
// flag; archy always wants this so we hardcode true.
claude.WithVerbose(true),
}
if opts.CLIPath != "" {
out = append(out, claude.WithCLIPath(opts.CLIPath))
Expand Down
11 changes: 6 additions & 5 deletions internal/agent/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ func TestBuildOptions_IncludesModelMaxTurnsPermission(t *testing.T) {
User: testIdentity(),
})
require.NoError(t, err)
// 4 base options (model, max-turns, permission, allowed-tools) + 1 archy MCP server = 5.
// External MCPs in baseline config = 0.
assert.Equal(t, 5, applyOpts(t, opts))
// 5 base options (model, max-turns, permission, allowed-tools,
// verbose) + 1 archy MCP server = 6. External MCPs in baseline
// config = 0.
assert.Equal(t, 6, applyOpts(t, opts))
}

func TestBuildOptions_RegistersExternalEnabledMCPServer(t *testing.T) {
Expand All @@ -54,7 +55,7 @@ func TestBuildOptions_RegistersExternalEnabledMCPServer(t *testing.T) {
}
opts, err := buildOptions(cfg, Options{ArchyBinaryPath: "/fake/archy", User: testIdentity()})
require.NoError(t, err)
assert.Equal(t, 6, applyOpts(t, opts), "5 base/archy + 1 external")
assert.Equal(t, 7, applyOpts(t, opts), "6 base/archy + 1 external")
}

func TestBuildOptions_SkipsDisabledExternalMCPServer(t *testing.T) {
Expand All @@ -64,7 +65,7 @@ func TestBuildOptions_SkipsDisabledExternalMCPServer(t *testing.T) {
}
opts, err := buildOptions(cfg, Options{ArchyBinaryPath: "/fake/archy", User: testIdentity()})
require.NoError(t, err)
assert.Equal(t, 5, applyOpts(t, opts))
assert.Equal(t, 6, applyOpts(t, opts))
}

func TestBuildOptions_ExternalServerBadScheme(t *testing.T) {
Expand Down
Loading