strix/strix
0xallam 418eedcd41 Clean up SDK shell tool failure modes
Three concrete wraps on exec_command / write_stdin via the existing
Shell capability configure_tools mechanism, plus one skill-doc fix.
All wraps fire on both Responses and chat-completions paths; the
chat-completions error-as-result wrap still stacks on top when needed.

- write_stdin: decode the common escape forms in `chars` (\uXXXX,
  \xXX, \n \t \r \0 \a \b \v \f \\). Models routinely send the
  literal six-char string `` intending the ASCII control byte;
  the SDK takes chars verbatim so the byte never reaches the PTY and
  documented mechanisms like Ctrl-C, arrows, and Escape silently
  don't work. Allowlist regex over recognized escapes only —
  unrecognized sequences like `\p` pass through untouched.

- exec_command: catch InvalidManifestPathError and rewrite to a
  model-actionable message ("workdir must be a path inside
  /workspace") using the exception's structured `context["rel"]` so
  we don't need to string-match the SDK's wording.

- Both tools: catch pydantic ValidationError once at the wrap and
  reformat into a short "{tool}: invalid arguments — {field}: {msg}"
  string. Covers empty cmd, missing required fields, ge/min_length
  violations on max_output_tokens and yield_time_ms — and any future
  schema field the SDK adds.

Updated python.md guidance: the `shell=` parameter is for swapping
POSIX shells (bash/zsh/sh). Interpreters belong in `cmd` —
`cmd="python3 -c '...'"`, not `shell=python3`. The `shell=interpreter`
shortcut breaks in interpreter-specific ways (python needs `-c`,
node/ruby/perl need `-e`) so there's no clean code fix and we don't
try one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:05:42 -07:00
..
agents Clean up SDK shell tool failure modes 2026-05-25 14:05:42 -07:00
config Support chat-compatible sandbox patch tool 2026-04-26 16:54:34 -07:00
core Support chat-compatible sandbox patch tool 2026-04-26 16:54:34 -07:00
interface Agents graph sweep: status taxonomy, stop_agent safety, skill validation 2026-05-25 01:35:57 -07:00
report Track SDK LLM usage 2026-04-26 15:38:41 -07:00
runtime Simplify SDK-native orchestration 2026-04-26 11:30:00 -07:00
skills Clean up SDK shell tool failure modes 2026-05-25 14:05:42 -07:00
telemetry Track SDK LLM usage 2026-04-26 15:38:41 -07:00
tools Stop web_search from leaking upstream details into tool results 2026-05-25 02:13:43 -07:00
utils fix(agent): fix tool schemas not retrieved on pyinstaller binary and validate tool call args 2026-01-14 10:57:32 -08:00
__init__.py Open-source release for Alpha version 2025-08-08 20:36:44 -07:00