Skip to content

Conversation

jif-oai
Copy link
Contributor

@jif-oai jif-oai commented Sep 8, 2025

Unified PTY-Based Exec Tool

Note: this requires to have this flag in the config: use_experimental_unified_exec_tool=true

  • Adds a PTY-backed interactive exec feature (“unified_exec”) with session reuse via
    session_id, bounded output (128 KiB), and timeout clamping (≤ 60 s).
  • Protocol: introduces ResponseItem::UnifiedExec { session_id, arguments, timeout_ms }.
  • Tools: exposes unified_exec as a function tool (Responses API); excluded from Chat
    Completions payload while still supported in tool lists.
  • Path handling: resolves commands via PATH (or explicit paths), with UTF‑8/newline‑aware
    truncation (truncate_middle).
  • Tests: cover command parsing, path resolution, session persistence/cleanup, multi‑session
    isolation, timeouts, and truncation behavior.

@jif-oai jif-oai requested a review from bolinfest September 9, 2025 20:29
Copy link
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job and thanks for the tests!

The only comment I feel strongly about is dropping the use of which. If the command does not exist, then the process should fail with ENOENT if we need to treat that case in a special way.

@jif-oai jif-oai merged commit c09ed74 into main Sep 11, 2025
19 checks passed
@jif-oai jif-oai deleted the jif/unified-exec branch September 11, 2025 00:38
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants