Skip to content

fix: hooks otel url#1795

Merged
chase-crumbaugh merged 1 commit intomainfrom
chase/hooks5
Mar 6, 2026
Merged

fix: hooks otel url#1795
chase-crumbaugh merged 1 commit intomainfrom
chase/hooks5

Conversation

@chase-crumbaugh
Copy link
Member

@chase-crumbaugh chase-crumbaugh commented Mar 6, 2026

We have some special rules on paths that start with rpc, so i need to move the hooks otel path behind there


Open with Devin

@chase-crumbaugh chase-crumbaugh requested a review from a team as a code owner March 6, 2026 23:04
@vercel
Copy link

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Mar 6, 2026 11:05pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

⚠️ No Changeset found

Latest commit: 17e964b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +6 to +10
curl -X POST \
-H "Content-Type: application/json" \
-d @- \
--max-time 30 \
"${server_url}/rpc/hooks.claude"
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 curl in send_hook.sh lacks -sS flag, causing progress meter noise on stderr

The curl command in send_hook.sh is missing the -sS (silent + show-errors) flag. When Claude Code runs a command-type hook, it captures stdout (for the hook response), but stderr flows to the user's terminal. By default, curl outputs a progress meter to stderr whenever stdout is redirected (i.e., not a terminal) — which is exactly the case here since Claude Code captures the command's stdout. This means every tool invocation will display curl's transfer progress bar in the user's terminal, which is disruptive and noisy.

Suggested change
curl -X POST \
-H "Content-Type: application/json" \
-d @- \
--max-time 30 \
"${server_url}/rpc/hooks.claude"
curl -sS -X POST \
-H "Content-Type: application/json" \
-d @- \
--max-time 30 \
"${server_url}/rpc/hooks.claude"
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +6 to +10
curl -X POST \
-H "Content-Type: application/json" \
-d @- \
--max-time 30 \
"${server_url}/rpc/hooks.claude"
Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 send_hook.sh does not handle curl failure, risking tool-blocking on network errors

The send_hook.sh script does not handle curl failures gracefully — if curl exits non-zero (e.g., DNS failure, server unreachable, timeout), the script propagates that non-zero exit code to Claude Code. For PreToolUse command-type hooks, a non-zero exit from the hook command may cause Claude Code to block the tool invocation. This is a regression from the previous http type hooks, where Claude Code handled HTTP failures internally with built-in resilience. Since this is a monitoring/analytics hook, it should never block the user's primary workflow. The fix is to append || true (or exit 0) so the script always exits successfully regardless of whether the telemetry request succeeded.

Suggested change
curl -X POST \
-H "Content-Type: application/json" \
-d @- \
--max-time 30 \
"${server_url}/rpc/hooks.claude"
curl -sS -X POST \
-H "Content-Type: application/json" \
-d @- \
--max-time 30 \
"${server_url}/rpc/hooks.claude" || true
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@chase-crumbaugh chase-crumbaugh merged commit 13972fb into main Mar 6, 2026
37 checks passed
@chase-crumbaugh chase-crumbaugh deleted the chase/hooks5 branch March 6, 2026 23:14
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2026
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