feat(transport): add LARK_CLI_NO_PROXY_WARN to silence proxy warning#1647
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds Proxy warning silent opt-out
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Poem
🚥 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 |
fb3bf34 to
a8f00b1
Compare
The proxy-detected warning is human-oriented but lands on stderr, which agents running the CLI in a PTY merge into stdout — polluting --format json output so consumers fail to parse it. The only existing way to silence it, LARK_CLI_NO_PROXY=1, also disables the proxy, which is not acceptable when the proxy is required for egress. Add a dedicated opt-out, LARK_CLI_NO_PROXY_WARN=1, that suppresses the warning (both env-proxy and proxy-plugin variants) while leaving proxy behavior unchanged. The warning message now advertises this option.
a8f00b1 to
6221d4f
Compare
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@a8f00b1c797df562193c7c925a48e2041efdf9ef🧩 Skill updatenpx skills add larksuite/cli#proxy-warn-opt-out-env -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1647 +/- ##
=======================================
Coverage 74.69% 74.69%
=======================================
Files 808 808
Lines 81527 81529 +2
=======================================
+ Hits 60896 60898 +2
Misses 16093 16093
Partials 4538 4538 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Background
The
[lark-cli] [WARN] proxy detected: ...line is a human-oriented warning written to stderr, and only when stderr is a terminal. But agents typically run the CLI inside a PTY and merge stderr into stdout, so the warning ends up in the--format jsonoutput stream and downstream consumers (models/scripts) fail to parse it as JSON.The only existing way to silence it,
LARK_CLI_NO_PROXY=1, also disables the proxy — not acceptable when the proxy is the required egress path.Change
Add
LARK_CLI_NO_PROXY_WARN: set to any non-empty value to silence the warning while leaving proxy behavior unchanged.LARK_CLI_NO_PROXY_WARN=1LARK_CLI_NO_PROXY=1internal/transport/warn.go: add theEnvNoProxyWarnconstant; short-circuit at the top ofWarnIfProxied, covering both the env-proxy and proxy-plugin warnings; the warning message now advertises this option.internal/transport/warn_test.go: add two tests — the warning is silenced while the proxy stays configured, and the plugin-mode warning is silenced too.Verification
go build ./...go test ./internal/transport/ ./internal/cmdutil/Summary by CodeRabbit
New Features
Bug Fixes
Tests