feat: propagate invocation metadata - #2097
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthrough
ChangesAgent Name Header
Repository Ownership Rules
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/cmdutil/secheader_test.go`:
- Around line 269-283: Add a test alongside
TestBaseSecurityHeaders_IncludesAgentNameHeaderWhenEnvSet that sets
envvars.CliAgentName to an invalid CR/LF-containing value, calls
BaseSecurityHeaders, and asserts HeaderAgentName is absent, preserving the
contract that invalid agent names leave requests unchanged.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: df90b99c-c550-4ce1-b2e2-7464b3ce7ebb
📒 Files selected for processing (2)
internal/cmdutil/secheader.gointernal/cmdutil/secheader_test.go
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@4d50250c7771d64fdb1a24d7f58f83dd762b3dab🧩 Skill updatenpx skills add larksuite/cli#feat/agent-name-header -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2097 +/- ##
==========================================
+ Coverage 75.16% 75.19% +0.03%
==========================================
Files 912 914 +2
Lines 96475 96783 +308
==========================================
+ Hits 72517 72778 +261
- Misses 18381 18407 +26
- Partials 5577 5598 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fa562b9 to
c2e378a
Compare
c2e378a to
4d50250
Compare
Summary
Extend shared request metadata propagation for agent-driven CLI invocations while preserving existing behavior when the metadata is unavailable or invalid.
Changes
@liangshuo-1review forgo.mod,go.sum, and shared shortcut infrastructure undershortcuts/common/.Test Plan
make unit-testgo vet ./...gofmt -l .produces no outputgo mod tidyproduces no changesgolangci-lint v2.1.6 run --new-from-rev=origin/mainRelated Issues
Summary by CodeRabbit
X-Agent-Nameheader when available.X-Agent-Namefrom being sent when the agent name is missing or contains invalid line-break characters, preserving existing security header behavior.