coily dispatch: interactive mode should refuse non-TTY / agent callers #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
coily dispatch <ref> interactivewrites a JSON queue entry under/tmp/coily-dispatch-queue/and fires awarppreview://tab_config/<name>URL viaopento spawn a new Warp tab. When the caller is an agent (Claude Code Bash tool) or any non-interactive context, two failure modes:opendoes not resolve thewarp://scheme. Already soft-fails viaprintInteractiveFallback(cli-guard/dispatch/interactive.go:360-363) but leaves an orphan queue file and prints fallback text the agent can't act on usefully.Neither is what an agent wants. Discovered in an SSH session from inside a Claude Code agent loop where the inner agent considered firing interactive dispatch and we walked through what would happen.
Fix
In
cli-guard/dispatch/interactive.go'srunInteractive(entry point at line 282), detect non-interactive callers up front and refuse:CLAUDECODE/CLAUDE_CODE_SSE_PORTenv vars set → agent caller.os.Stdinis not a TTY (golang.org/x/term.IsTerminal(int(os.Stdin.Fd()))) → piped/headless caller.runtime.GOOS == "linux"→ no Warp consumer for the queue.Error out before writing the queue entry, with:
Why
Saves the stealth-spawn footgun on Mac, saves the orphan queue file + opaque fallback on Linux, and the tool says clearly what to do next instead of pretending to work.
Meta-context
Filing this on forgejo via curl + the
/forgejo/api-tokenSSM secret because GH issues are disabled oncoilysiren/cli-guardand nocoily ops forgejo issue createverb exists yet. Adding that verb is its own meta-improvement worth filing separately.Design context: coilysiren/coily#270 (headless/interactive split), coilysiren/coily#310 (move to cli-guard/dispatch package).
issue createverb so agents can file forgejo issues without curl+SSM #69