Skip to content

fix(core): reject oversized Windows shell commands - #327

Open
vikas-bottomless wants to merge 1 commit into
mainfrom
fix/windows-command-length
Open

vikas-bottomless wants to merge 1 commit into
mainfrom
fix/windows-command-length

Conversation

@vikas-bottomless

Copy link
Copy Markdown
Contributor

What and why

On Windows, a shell command longer than the system limit could hang a battle side until the user pressed Stop. A user hit this twice, with commands of 48,639 and 51,304 characters. The shell tool now refuses such a command before asking permission or starting a process. The error tells the agent to split the command or save it as a script. Windows allows 32,767 characters per command line; cmd.exe allows 8,191.

Testing

  • [automated] bun test test/windows-command-line.test.ts test/tool-shell.test.ts (core, Bun 1.4.4): 88 passed, 6 skipped, 2 failed; the same 2 fail without this change
  • [automated] Windows-only tests with the Windows check forced on, on macOS: 2 passed; both fail without the check
  • [automated] bun run typecheck in core and opencode, npm run typecheck, npm run lint, npm run format:check: pass
  • [AI] Claude Code ran the length check on commands of 48,639 and 51,304 characters, and on 31,500 characters with 1,300 quotes: all refused; a short command was allowed
  • Not tested: a real Windows machine; a battle in the app; commands that don't come from the agent's shell tool (automations, session shells), which this doesn't cover

Checklist

  • "What and why" is at most 500 characters
  • npm run typecheck, npm run lint and npm run format pass
  • Screenshots or video attached for UI changes
  • I agree to the contribution licensing policy and have authority to license my contribution.

@vikas-bottomless
vikas-bottomless requested a review from a team as a code owner December 3, 2026 14:04

This branch has not been deployed

No deployments
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