fix(trajectory-plugin): bound capture-hook call to avoid lost hook output - #56
Open
audip wants to merge 1 commit into
Open
fix(trajectory-plugin): bound capture-hook call to avoid lost hook output#56audip wants to merge 1 commit into
audip wants to merge 1 commit into
Conversation
…tput capture-with-serve.sh execed trajectory capture-hook with no timeout of its own, relying entirely on Claude Code's outer hook timeout. When the shared serve daemon is busy for 20-30s+ on unrelated work (batch repairs, marker evaluation, publish retries), the hook gets hard-killed by the host tool and its output is discarded. Wrap the call in timeout/gtimeout (default 5s, overridable via TRAJECTORY_CAPTURE_HOOK_TIMEOUT_SECONDS) so it fails open instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #54
capture-with-serve.shexecedtrajectory capture-hookwith no timeout of its own, relying entirely on Claude Code's outer hook timeout. When the shared serve daemon is busy for 20-30s+ on unrelated work (batch repairs, marker evaluation, publish retries — observed a 32smarkers_session_endpublish stall against OTLP), the hook gets hard-killed by the host tool and its output is discarded, regardless of how high the host tool's own timeout is raised.This wraps the final
capture-hookcall intimeout/gtimeout(default 5s, overridable viaTRAJECTORY_CAPTURE_HOOK_TIMEOUT_SECONDS) so a busy daemon causes a fast, cleanexit 0instead of an eventual hard kill with discarded output. If neithertimeoutnorgtimeoutis present (stock macOS without coreutils), it falls back to the original unboundedexec, so behavior is unchanged on those systems.Verified with
bash -nand running locally against a real busy-daemon scenario without regressions.