fix: large tool inputs break bash PTC replay and pending-call serialization - #48
fix: large tool inputs break bash PTC replay and pending-call serialization#48kenzaelk98 wants to merge 3 commits into
Conversation
bf21a61 to
6325b72
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6325b7270c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
danny-avila
left a comment
There was a problem hiding this comment.
The oversized-input handling and replay regression coverage look good. One configuration edge case needs fixing before merge.
|
@codex review the latest head |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
thanks for the PR, replacing with #75 while keeping your original commits for credit where it's due |
Bash PTC tools are meant to handle arbitrary-size input, but the preamble's
internal plumbing quietly assumes inputs stay well under the kernel's
ARG_MAX(~128KB) — which isn't a safe assumption for every PTC use case.Problem
Three spots in the bash PTC preamble pass raw tool input to
jqvia--argjson(a command-line argument), capped byARG_MAX:_ptc_call_tool's pending-call write hits this hard:jqfails outrightand the script aborts with "Argument list too long."
_ptc_history_matches_by_signature/_ptc_history_entry_matches_current_callhit it silently instead — the error is swallowed, so a cached result never
matches, and the call re-executes on every replay round rather than
reusing it.
Fix
Read the input via stdin (pending-call write — stdin is free there) or
--slurpfile(the two matchers — stdin is already used for their primaryinput) instead of argv, in all three spots.
Also makes
tool_history's per-entry/aggregate byte caps inreplay-state.tsconfigurable viaPTC_MAX_TOOL_RESULT_BYTES/PTC_MAX_TOOL_HISTORY_TOTAL_BYTES(defaults unchanged), for deploymentswhose tools return larger outputs.
Testing
run instead of re-issuing.
bun run build/bun run testpass inservice/.