Skip to content

fix Windows terminal capability detection#1716

Open
fengju0213 wants to merge 1 commit into
mainfrom
codex/fix-missing-terminal-tool-crash
Open

fix Windows terminal capability detection#1716
fengju0213 wants to merge 1 commit into
mainfrom
codex/fix-missing-terminal-tool-crash

Conversation

@fengju0213

Copy link
Copy Markdown
Collaborator

Summary

  • Detect native Windows shells when deciding whether the backend can register terminal tools.
  • Keep existing bash/sh detection for POSIX environments.
  • Add regression coverage for Windows PowerShell and POSIX sh detection.

Root Cause

BrainCapabilities only checked for bash before enabling the terminal hand. On Windows desktop installs, users can have PowerShell or cmd available without bash, so the backend marked terminal as unavailable and skipped TerminalToolkit. The multi-modal agent could then call shell_exec from its prompt even though the tool was not registered, producing KeyError: 'shell_exec'.

Validation

  • uv run pytest tests/app/hands/test_capabilities.py
  • uv run ruff check app/hands/capabilities.py tests/app/hands/test_capabilities.py
  • uv run ruff format --check app/hands/capabilities.py tests/app/hands/test_capabilities.py
  • backend pre-commit hooks during commit

@fengju0213 fengju0213 changed the title [codex] fix Windows terminal capability detection fix Windows terminal capability detection Jun 29, 2026
@fengju0213 fengju0213 marked this pull request as ready for review June 29, 2026 07:57
@fengju0213 fengju0213 linked an issue Jun 29, 2026 that may be closed by this pull request
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.

报告 bug

1 participant