Skip to content

fix: display exception category, not raw text, in op SDK install paths - #132

Merged
github-actions[bot] merged 1 commit into
mainfrom
claude/op-cli-exc-hardening-16182
Aug 1, 2026
Merged

fix: display exception category, not raw text, in op SDK install paths#132
github-actions[bot] merged 1 commit into
mainfrom
claude/op-cli-exc-hardening-16182

Conversation

@dizhaky

@dizhaky dizhaky commented Aug 1, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Follow-up to #130. CodeQL's clear-text-logging check reported "2 new alerts including 2 high severity" on #130's fix commit (08dc27c), after that PR had already merged. This closes the gap: the last two except Exception as exc: handlers in hermes_cli/secrets_cli.py still printed str(exc) directly.

Related Issue

Follow-up to #130.

Type of Change

  • 🔒 Security fix

Changes Made

hermes_cli/secrets_cli.py:

  • cmd_op_setup Step 1 (install_onepassword_sdk() failure): {exc}{type(exc).__name__}
  • cmd_op_install: same conversion

Both are now consistent with every other exception display in this module — a bare exception-class name, never the message text, matching the "Error categories" convention already established in agent/secret_sources/onepassword.py.

I audited every remaining logger.warning/console.print call across onepassword.py, env_loader.py, and secrets_cli.py for this data-flow shape; these two were the only unconverted sites left.

How to Test

bash scripts/run_tests.sh tests/test_onepassword_secrets.py tests/test_env_loader_secret_sources.py tests/tools/test_local_env_blocklist.py

Verification

  • ruff check hermes_cli/secrets_cli.py — clean.
  • 66/66 relevant tests pass (no test asserted on the raw exception text these lines used to print).

Generated by Claude Code

Two `cmd_op_setup`/`cmd_op_install` exception handlers still printed
str(exc) from install_onepassword_sdk() failures — the last two sites in
this module not already converted to type(exc).__name__, matching every
other exception display here.
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

🔎 Lint report: claude/op-cli-exc-hardening-16182 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9238 on HEAD, 9238 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5103 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@dizhaky
dizhaky marked this pull request as ready for review August 1, 2026 20:52
@github-actions
github-actions Bot merged commit 99efa8d into main Aug 1, 2026
33 checks passed
@github-actions
github-actions Bot deleted the claude/op-cli-exc-hardening-16182 branch August 1, 2026 20:52
dizhaky pushed a commit that referenced this pull request Aug 1, 2026
…ening with merged #127/#130/#132

Conflict resolutions:
- agent/secret_sources/onepassword.py (add/add): took main's version — it is
  the branch's file plus two hardening hunks that route tainted field
  labels/env names into the warnings list (surfaced only as counts) instead
  of logger.warning.
- hermes_cli/secrets_cli.py: took main's side of both hunks — exception
  category display (type(exc).__name__) instead of str(exc).
- .claude/settings.json: kept branch's newer server-memory pin (0.6.3).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014quAJiFx19py9nV6NnsnHr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants