claude-code - 💡(How to fix) Fix [BUG] decision_type field on tool_result OTEL events not populated in ~70% of cases since v2.1.143 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60726Fetched 2026-05-20 03:51:06
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

Error Messages/Logs

Code Example

┌─────────┬──────────────┬─────────────────┐                                                                                                                    
VersionRelease DatePopulation Rate  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
2.1.136May 891%  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
2.1.138May 955%  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
2.1.141May 1347%  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
2.1.142May 1466%  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
2.1.143May 1531%  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
2.1.144May 1872%  └─────────┴──────────────┴─────────────────┘

---

### Error Messages/Logs
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The decision_type attribute on tool_result OTEL log events is inconsistently emitted starting in version 2.1.143. The documentation states this field should be either "accept" or "reject", but it's absent (null) for ~71% of tool_result events in 2.1.143, up from ~54% in 2.1.142.

What Should Happen?

Per docs, tool_result events should include:

▎ decision_type: Either "accept" or "reject"

Every tool_result that has a corresponding tool_decision event (which is all of them) should carry decision_type forward from the decision context.

Observed Behavior

decision_type population rate by version (measured across ~12.5M tool_result events):

  ┌─────────┬──────────────┬─────────────────┐                                                                                                                    
  │ Version │ Release Date │ Population Rate │                    
  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
  │ 2.1.136 │ May 8        │ 91%             │                    
  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
  │ 2.1.138 │ May 9        │ 55%             │                                                                                                                    
  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
  │ 2.1.141 │ May 13       │ 47%             │                                                                                                                    
  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
  │ 2.1.142 │ May 14       │ 66%             │                    
  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
  │ 2.1.143 │ May 15       │ 31%             │                    
  ├─────────┼──────────────┼─────────────────┤                                                                                                                    
  │ 2.1.144 │ May 18       │ 72%             │                    
  └─────────┴──────────────┴─────────────────┘

The drop is uniform across all decision_source values (config, user_temporary, user_permanent, hook) — it's not specific to any decision type:

  │ decision_source │   Total   │ Population Rate │               
  ├─────────────────┼───────────┼─────────────────┤                                                                                                               
  │ config          │ 7,400,899 │ 39%             │               
  ├─────────────────┼───────────┼─────────────────┤                                                                                                               
  │ user_temporary  │ 567,663   │ 74%             │                                                                                                               
  ├─────────────────┼───────────┼─────────────────┤                                                                                                               
  │ user_permanent  │ 252,464   │ 30%             │                                                                                                               
  ├─────────────────┼───────────┼─────────────────┤                                                                                                               
  │ hook (accept)   │ 31,341    │ 1.2%            │               
  └─────────────────┴───────────┴─────────────────┘

Error Messages/Logs

Steps to Reproduce

  1. Enable OTEL telemetry on Claude Code >= 2.1.143:
    export CLAUDE_CODE_ENABLE_TELEMETRY=1
    export OTEL_LOGS_EXPORTER=otlp
    export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
    export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
    claude
  2. Run a simple prompt that triggers multiple tool uses (e.g., "list files in this directory and read the first one"). This will generate Bash/Read tool calls.
  3. Observe the emitted OTEL log events in your collector. For each tool invocation you should see two events:
    - tool_decision — always has decision and source attributes
    - tool_result — should have decision_type and decision_source attributes
  4. Compare: Many tool_result events will be missing decision_type and decision_source, despite having a corresponding tool_decision event with the same
    tool_use_id that correctly carries decision and source.
  5. Verify with a simple count:
    -- If collecting to any SQL-queryable store:
    SELECT
    COUNT(*) AS total_tool_results,
    SUM(CASE WHEN decision_type IS NOT NULL THEN 1 ELSE 0 END) AS has_decision_type,
    SUM(CASE WHEN decision_type IS NULL THEN 1 ELSE 0 END) AS missing_decision_type
    FROM events
    WHERE event_name = 'tool_result';
  6. Expected: missing_decision_type should be 0.
    Actual: ~70% of rows are missing on v2.1.143.
  7. Cross-reference with tool_decision:
    SELECT
    td.decision,
    td.source,
    tr.decision_type -- NULL despite td.decision being populated
    FROM events tr
    JOIN events td ON tr.tool_use_id = td.tool_use_id AND td.event_name = 'tool_decision'
    WHERE tr.event_name = 'tool_result'
    AND tr.decision_type IS NULL
    LIMIT 5;
  8. This demonstrates that the decision was made and logged, but not propagated to the tool_result event.

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.131 =

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] decision_type field on tool_result OTEL events not populated in ~70% of cases since v2.1.143 [1 participants]