refactor(agents): simplify mergeTelemetry implementation#76
Conversation
…acted constant Extract magic string "funkai.agentChain" into an AGENT_CHAIN_METADATA_KEY constant and replace the mutable merged variable + isNil guard with a single return expression using nullish coalescing for functionId. Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: a11fd3f The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdded a changeset configuration file and refactored the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/agents/src/core/agents/base/telemetry.ts`:
- Around line 6-7: The JSDoc for the AGENT_CHAIN_METADATA_KEY constant is
currently a single-line block causing the jsdoc-js(multiline-blocks) warning;
update the comment above AGENT_CHAIN_METADATA_KEY to a multiline JSDoc block by
expanding it into the standard /* * ... */ multi-line form (i.e., start /** on
its own line, put the description on the next line prefixed with *, and close */
on its own line) so the symbol AGENT_CHAIN_METADATA_KEY in telemetry.ts uses a
multiline JSDoc comment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4de21fe8-092a-422d-add3-0437ee75d560
📒 Files selected for processing (2)
.changeset/telemetry-cleanup.mdpackages/agents/src/core/agents/base/telemetry.ts
Summary
"funkai.agentChain"magic string into anAGENT_CHAIN_METADATA_KEYconstant for clarity and single-source-of-truthmergedvariable +isNilguard with a direct return using nullish coalescing (??) forfunctionIdTest plan
pnpm typecheck --filter=@funkai/agentspassespnpm test --filter=@funkai/agents— all 665 tests pass