Repository navigation
feat: capture prompt_id + reasoning-effort level (v0.22.3) - #96
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR bumps the plugin manifest version from 0.22.1 to 0.22.3 and adds a prompt_id field to the structured event JSON payload written by the logger's runHook function, sourced from input.prompt_id, omitted when undefined. ChangesVersion and logging update
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Add the per-prompt correlation id (Claude Code v2.1.196+) to every event's data via the central assembly in runHook, so all hook events a single user prompt produced share one prompt_id — enabling per-turn analysis (tools/turn, turn duration, retries). It's a random UUID (not PII, no sanitization) and is omitted on older runtimes where the field is absent. Thanks to the data-driven dispatcher, no per-hook change is needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
Release the prompt_id per-turn correlation capture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
6cefa61 to
c5fcf99
Compare
MessageDisplay fires per streaming delta (hundreds/turn = a node spawn each) and its turn_id/message_id have no documented, stable join to the transcript, so it's removed (registry + hooks.json + the runHook null-skip + central turn_id it required). Complete the common-input-fields coverage in the central event data: - re-add effort_level (the effort capture was lost in #96's rebase and never reached main) - add agent_id / agent_type centrally so subagent context is recorded on EVERY event fired inside a subagent (not just the Subagent* lifecycle events) All 9 documented common fields are now captured: session_id, hook_event_name, prompt_id, transcript_path, cwd, permission_mode, effort_level, agent_id, agent_type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979
* feat: add 5 hook events + fix stale field names for max coverage New observation-only hook events (via the dispatcher — registry + hooks.json): - Setup (setup_type), CwdChanged (path, hashed), MessageDisplay (message_length only — content lives in the transcript), Elicitation (server/tool_name/ tool_input), ElicitationResult (server/tool_name; raw user_response omitted for privacy). Field-name corrections to match the current hook input schema — these events were previously capturing undefined: - StopFailure: error_type/error_message (was error/error_details) - TeammateIdle: agent_type - TaskCreated: task_metadata; TaskCompleted: completion_status - ConfigChange: config_source; WorktreeCreate: worktree_name/worktree_path - Notification: dropped nonexistent title; InstructionsLoaded: dropped memory_type Also: SessionStart now captures session_title. Coverage/field tests added. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979 * chore: bump version to 0.22.4 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979 * feat: capture turn_id globally; MessageDisplay = ids-only, final-chunk-only MessageDisplay fires per streaming delta, so capture no content and log only the final chunk: - add turn_id to the central event fields (all events get turn-level correlation, free — like prompt_id) - MessageDisplay mapper returns { message_id } on final, else null - runHook now treats a null mapper return as 'skip logging this occurrence' (the hook still ran; nothing is written) Result: one lightweight record per assistant message (turn_id + message_id, no delta), instead of a content-bearing record per chunk. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979 * refactor: drop MessageDisplay; capture all common input fields MessageDisplay fires per streaming delta (hundreds/turn = a node spawn each) and its turn_id/message_id have no documented, stable join to the transcript, so it's removed (registry + hooks.json + the runHook null-skip + central turn_id it required). Complete the common-input-fields coverage in the central event data: - re-add effort_level (the effort capture was lost in #96's rebase and never reached main) - add agent_id / agent_type centrally so subagent context is recorded on EVERY event fired inside a subagent (not just the Subagent* lifecycle events) All 9 documented common fields are now captured: session_id, hook_event_name, prompt_id, transcript_path, cwd, permission_mode, effort_level, agent_id, agent_type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoEUHYQTz1Tx61FcteE979 --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Capture two per-turn hook-input signals on every telemetry event, via the central
dataassembly inrunHook(no per-hook change needed thanks to the data-driven dispatcher).Changes
prompt_id(Claude Code v2.1.196+): per-prompt correlation id grouping every event a single user prompt produced into one turn.effort_level(hook inputeffort.level: low|medium|high|xhigh|max): the turn's reasoning-effort level.Why
Events now group
session_id(session) →prompt_id(turn) →tool_use_id(tool call), and turns can be segmented by reasoning effort.prompt_idcorrelates with OpenTelemetry per the docs.Verification
node --test→ 55/55 pass;claude plugin validate✔.audclaim (v0.22.2) #95 (aud) merged; different files, no content conflict.🤖 Generated with Claude Code