Repository navigation
fix(vulnogram): exit cleanly without a TTY and point to --pmc (#1733) - #1742
Merged
Merged
Conversation
…#1733) When executed from an agent shell escape or non-interactive environment, the default paste flow of vulnogram-api-setup raised EOFError with an unhandled traceback. - Catch EOFError/KeyboardInterrupt and detect non-interactive stdin in setup_session.py to exit cleanly with code 1 and actionable instructions - Protect the ASF account prompt in resolve_from_address against EOFError - Mention --pmc <project> first in expired-token hints across client.py, push.py, skill guidance, and documentation - Add unit tests covering non-interactive stdin and EOF handling Generated-by: Antigravity
…ooping getpass reads from /dev/tty before stdin, so a non-tty stdin does not mean there is no terminal: drop the isatty() pre-check that rejected those runs. After a --pmc fallback to the paste prompt, point at --token rather than back at --pmc, and let Ctrl-C exit as before instead of reporting "No terminal". Generated-by: Claude Opus 5
potiuk
approved these changes
Oct 20, 2026
potiuk
left a comment
Member
There was a problem hiding this comment.
Thanks @Kaap10, the EOF handling fixes #1733. I pushed one small fixup commit (4647683) instead of a review round trip:
- Dropped the
sys.stdin.isatty()pre-check (and the autouse_interactive_stdinfixture and its test).getpassreads from/dev/ttyfirst and falls back to stdin only when no terminal can be opened, so a non-tty stdin does not mean there is no terminal: the check rejected redirected runs that still had a working tty. Theexcept EOFErroralready covers the #1733 case. - The no-terminal hint no longer loops. With
--pmc, the paste prompt is only reached when the server has no browser approval, so the hint now says to pass--token <token>there instead of re-running with--pmc. A new test covers that fallback. - Ctrl-C exits as before. Catching
KeyboardInterruptreported "No terminal" for an interrupt at a working terminal, so both prompts now catch onlyEOFError. - README: the "Re-running setup is a 30-second operation" sentence now leads with the
--pmc <project>browser approval.
ruff and the oauth-api tests (177) pass locally.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
potiuk
enabled auto-merge (squash)
October 20, 2026 20:20
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.
Summary
sys.stdin.isatty()) and handle(EOFError, KeyboardInterrupt)invulnogram-api-setup, printing a clean error pointing to--pmc <project>instead of an unhandled traceback.resolve_from_address()againstEOFErrorwhen prompting for an ASF account in a non-interactive shell without--from-address.--pmc <project>first in expired-token hints and documentation across skills and tool adapters.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
tools/cve-tool-vulnogram/oauth-api/tests/test_setup_session.py:test_paste_prompt_without_tty_aborts_cleanlytest_paste_prompt_eof_aborts_cleanlytest_resolve_from_address_eof_aborts_cleanlypytest test_setup_session.py(30 passed)pytest test_issue_sync_rules.py(37 passed)pytest test_cve_allocate.py(95 passed)uv run ruff checkanduv run ruff format --checkpassed cleanlyRFC-AI-0004 compliance
<PROJECT>,<tracker>,<upstream>,<security-list>) used in all skill / tool prose (thecheck-placeholdersprek hook is the mechanical gate)Linked issues
Closes #1733
Notes for reviewers (optional)
Run from an agent shell escape (such as Claude Code's
!),getpassraisedEOFErrorbecause stdin lacked a controlling terminal. The browser-approval flow (--pmc <project>) works in the same environment. This PR intercepts the error, exits with status 1, and guides the operator to--pmc.