Commit graph

11 commits

Author SHA1 Message Date
Alex Schapiro
4dcd543db7 fix(shell): validate shell yields against the PTY ceiling
The PTY layer clamps any yield above its maximum, so a larger configured value bought nothing and looked effective. Bound both yield settings by that constant instead, and take the exec default from it.
2026-08-25 18:54:31 +00:00
Alex Schapiro
7ef555ad19 docs(shell): note the PTY layer's 30s yield ceiling
The SDK clamps every PTY yield to 30s and floors an empty poll at 5s. Record that where the defaults are set, and tell the agent a slower command still backgrounds so it harvests it with one poll per 30s instead of asking for an unreachable yield.
2026-08-25 18:47:56 +00:00
Alex Schapiro
3fea23de7e refactor(shell): let the agent size its own exec yield instead of a binary list
Drop the hardcoded long-running-binary set and its exec_long_yield_ms default. The wrapper no longer guesses how long a command runs from its leading binary: every omitted yield_time_ms gets the same 30s default, and the prompt asks the agent to pass a longer yield itself when it expects a slow command.
2026-08-25 18:13:36 +00:00
Alex Schapiro
88b3e50a5e test(shell): cover wrapper error formatting
Assert exec_command/write_stdin wrappers render ValidationError and invalid-workdir errors as messages instead of raising.
2026-08-25 15:32:50 +00:00
Alex Schapiro
6b9318ae07 perf(shell): raise default yield times so agents stop polling backgrounded shells
The SDK yields after only 250ms on a `write_stdin` poll and 10s on `exec_command`, so agents burn many turns re-polling a backgrounded process for almost no output. Each poll costs a full LLM turn, which makes even trivial commands take minutes of wall time.

Raise the defaults in the existing `exec_command` / `write_stdin` wrappers:

- an empty-`chars` `write_stdin` (a poll, not input) yields 20s instead of 250ms, so one poll returns a meaningful result
- `exec_command` yields 30s by default, and 120s for known long-running security binaries matched on the leading binary of the command
- a bare `sleep N` hand-wait is clamped to 60s and annotated with a hint pointing at `write_stdin(chars="")`, which returns as soon as there is output or the process exits

Every override is skipped when the model passes `yield_time_ms` explicitly, and the new values are configurable through `STRIX_SHELL_*` env vars. Command parsing fails open: an unparsable command just gets the plain default, and a `sleep` inside a compound command is never rewritten.
2026-08-25 15:30:20 +00:00
devin-ai-integration[bot]
3b79e97f00
feat(context): spill oversized tool output into the sandbox workspace (#882)
Co-authored-by: Ahmed Allam <ahmed39652003@gmail.com>
2026-07-26 14:42:22 -07:00
Ahmed Allam
74f334cb93 refactor(context): trim verbose comments 2026-07-26 14:38:12 -07:00
Ahmed Allam
6bda366065 fix(context): bound native filesystem tool output in Responses mode
Chat-completions mode converts filesystem CustomTools to FunctionTools
(which bounds their result), but the Responses-API path kept them native
and unbounded, so a large read_file could still exhaust the context
window. Always configure the Filesystem capability to head+tail bound
tool output in both modes.
2026-07-26 14:38:12 -07:00
Ahmed Allam
1f36f5d401 fix(context): clamp shell output cap and count byte-trimmed dropped lines
Treat tool_output_max_tokens as a ceiling so an explicit model-supplied
cap can't exceed it, and derive the truncation notice's dropped-line
count from the lines actually kept after the byte-trim pass. Also cast
the pygments fallback lexer so it satisfies the resolve_lexer return
type under the pre-commit mypy hook.
2026-07-26 14:38:12 -07:00
Ahmed Allam
a70a87f272 feat(context): bound per-tool output before it enters agent history
Cap the size of every tool result so a single verbose command (recursive
find, noisy scanner, full page dump) can't pin the conversation near the
model's context window for the rest of a scan.

- New ContextSettings config group with env-tunable caps.
- Default the SDK shell tools' max_output_tokens so exec_command /
  write_stdin truncate head+tail instead of returning unbounded output.
- Bound Strix's own FunctionTool/CustomTool results (line + UTF-8 byte
  head+tail preview with a truncation notice) and cap error strings.
2026-07-26 14:38:12 -07:00
alex s
e69c8f6633
Default sandbox exec commands to Bash (#764)
Co-authored-by: Ahmed Allam <ahmed39652003@gmail.com>
2026-07-14 03:44:05 -07:00