Skip to content

Use Claude Agent SDK hooks as lifecycle index#9200

Closed
mr-lee wants to merge 3 commits into
DataDog:feat/claude-agent-sdk-integrationfrom
mr-lee:codex/claude-agent-sdk-hook-context
Closed

Use Claude Agent SDK hooks as lifecycle index#9200
mr-lee wants to merge 3 commits into
DataDog:feat/claude-agent-sdk-integrationfrom
mr-lee:codex/claude-agent-sdk-hook-context

Conversation

@mr-lee

@mr-lee mr-lee commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • inject Claude Agent SDK lifecycle hooks at query start and preserve user-provided hooks
  • use hook-captured tool/session semantics plus a single stream index for LLM/tool payload enrichment
  • add a sirun benchmark comparing repeated stream scanning with hook-indexed lifecycle lookup

Validation

  • ./node_modules/.bin/eslint packages/datadog-instrumentations/src/claude-agent-sdk.js packages/datadog-plugin-claude-agent-sdk/test/index.spec.js benchmark/sirun/plugin-claude-agent-sdk/index.js
  • node -c packages/datadog-instrumentations/src/claude-agent-sdk.js && node -c packages/datadog-plugin-claude-agent-sdk/test/index.spec.js && node -c benchmark/sirun/plugin-claude-agent-sdk/index.js
  • VARIANT=stream-scan OPERATIONS=25000 node benchmark/sirun/plugin-claude-agent-sdk/index.js
  • VARIANT=hook-indexed OPERATIONS=25000 node benchmark/sirun/plugin-claude-agent-sdk/index.js

Focused Claude Agent SDK mocha specs were attempted locally after generating versions/ fixtures and starting testagent. They timed out before reaching assertions; a no-dd-trace SDK smoke query also timed out without any VCR request reaching testagent, so this appears to be local generated SDK binary/runtime behavior rather than an instrumentation assertion failure.

@datadog-official

datadog-official Bot commented Jul 2, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 150 Pipeline jobs failed

All Green | all-green   View in Datadog   GitHub Actions

CodeQL | Analyze (javascript)   View in Datadog   GitHub Actions

Project | package-size-report   View in Datadog   GitHub Actions

View all 150 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c745092 | Docs | Datadog PR Page | Give us feedback!

@mr-lee

mr-lee commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing this stacked comparison PR now that the implementation is carried by the canonical upstream PR #9202.

@mr-lee mr-lee closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant