fix(cli): import rich.progress symbols used by agentid commands#493
Open
JSap0914 wants to merge 1 commit into
Open
fix(cli): import rich.progress symbols used by agentid commands#493JSap0914 wants to merge 1 commit into
JSap0914 wants to merge 1 commit into
Conversation
The agentid subcommands (verify/info/resolve/verify-token/challenge/token/auth/claim) in cli_identity.py use Progress, SpinnerColumn and TextColumn inside a 'with Progress(...)' block but never imported them, so each command raised NameError: name 'Progress' is not defined before any network call. Add the missing 'from rich.progress import Progress, SpinnerColumn, TextColumn' (mirroring cli_agent.py) and a regression test that invokes 'agentid verify' with the verifier stubbed offline and asserts no NameError.
|
@JSap0914 is attempting to deploy a commit to the Raphael's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes a runtime NameError in agentid CLI subcommands by importing the missing rich.progress symbols and adds a regression test to ensure agentid verify reaches the (stubbed) network layer without crashing.
Changes:
- Import
Progress,SpinnerColumn, andTextColumnincli_identity.pyto avoidNameErrorat runtime. - Add a regression test that stubs the verifier and asserts the command doesn’t crash with
NameError.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/agentid/test_cli_identity_imports.py | Adds regression coverage for the CLI crash scenario by invoking agentid verify with a stubbed verifier. |
| sdk/src/openagents/client/cli_identity.py | Adds missing rich.progress imports used by CLI progress blocks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+8
| The ``agentid`` subcommands (verify / info / resolve / verify-token / | ||
| challenge / token / auth / claim) use ``Progress``, ``SpinnerColumn`` and | ||
| ``TextColumn`` from ``rich.progress`` inside a ``with Progress(...)`` block. | ||
| Those names were never imported in ``cli_identity.py``, so every one of those | ||
| commands crashed with ``NameError: name 'Progress' is not defined`` the moment | ||
| it reached the progress block — before any network call. |
| def validate(self, agent_id): | ||
| raise AgentIDConnectionError("offline (test stub)") | ||
|
|
||
| monkeypatch.setattr(agentid, "AgentIDVerifier", _OfflineVerifier) |
Comment on lines
+42
to
+44
| assert not isinstance(result.exception, NameError), ( | ||
| f"agentid verify raised NameError: {result.exception}" | ||
| ) |
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.
Bug
Every
agentidsubcommand insdk/src/openagents/client/cli_identity.pycrashes withNameError: name 'Progress' is not defined.The commands use
Progress,SpinnerColumnandTextColumninside awith Progress(...) as progress:block, butcli_identity.pynever imports them fromrich.progress. TheNameErroris raised the moment the command reaches the progress block — before any network call — so the commands are completely unusable.Affected subcommands:
verify,info,resolve,verify-token,challenge,token,auth,claim.The sibling
cli_agent.pyimports these symbols correctly; this just mirrors that import. (Same class of bug as thecli_agent.pymissing-import fix.)Fix
Add the missing import to
cli_identity.py:Verification
Added
tests/agentid/test_cli_identity_imports.py, which invokesagentid verifyviatyper.testing.CliRunnerwith the verifier stubbed to stay offline, and asserts the command does not raiseNameErrorand takes its handled error path.Before the fix this test fails with
NameError: name 'Progress' is not defined. Fulltests/agentidsuite still passes (51 passed).