Repository navigation
fix(cli): -v logs agent-env's debug messages and only other libraries' warnings - #172
Merged
Merged
Conversation
…' warnings `agent-env -v` set the root logger to DEBUG, so every library logged its debug messages, and hpack logs each HTTP/2 header it encodes: a verbose run's output carried Modal's x-modal-token-id and x-modal-token-secret hundreds of times. -v now sets DEBUG on agent-env's own loggers (agent_env, agentenv_protocol), and other libraries log warnings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The first commit left agent_env's logger at DEBUG after an in-process `-v` command, so later commands in that process, and the unit tests after one (plugin check's own report, with pytest's live logging on), saw it. -v's levels are now a resource of the command's context, as its namespace routing is. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
agentenvhub-sdk 0.34.0, which the integration build installs, needs agentenv-framework>=0.9.1319. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
agent-env -vno longer writes Modal's token to its output.Why
-vcalledlogging.basicConfig(level=logging.DEBUG), which turns on every library's debug logging. Modal's client speaks HTTP/2 through h2, whosehpacklogs each header it encodes, so a verbose run that touched Modal printedx-modal-token-idandx-modal-token-secretin plain text, hundreds of times per run. Anyone pasting-voutput into an issue or a chat would hand over their Modal token. Other libraries' debug logs (botocore, httpx) can carry signed URLs and request details too.What
-vsets DEBUG on agent-env's own loggers,agent_envandagentenv_protocol, and leaves the root logger at WARNING, so other libraries log their warnings only. The help text says so. The levels last for the command: they're a resource of its click context, as its namespace routing is, so a CLI invoked in-process leaves the caller's logging as it was.Tests
Unit tier: 7,459 passed, with pytest's live logging on as CI runs it. New: in a fresh interpreter, as the CLI runs, agent-env's and the protocol's debug messages are logged, hpack's debug message carrying
x-modal-token-secretisn't, and hpack's warning is; and a-vcommand run in-process leaves the loggers' levels as they were. The first commit left them at DEBUG, which brokeplugin check's tests when they ran after a--verbosetest in the same worker.Live, a
-vbundle run on Modal from fresh local stores: 64 lines of output, 48 of them agent-env's, none from hpack, no token. The same run logged 600 to 700 KB before, most of it hpack's header encoding.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues remain.Summary
-venables debug messages fromagent_envandagentenv_protocolwithout enabling other libraries’ debug messages in a fresh process.Reviews (3) · Last reviewed commit: "Merge main (v0.9.1320) into verbose-logs..." · Reviewed by Greptile