hermes - 💡(How to fix) Fix Pre-existing failure: test_returns_token_from_credential_files [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

During work on fix/soul-md-scanner-false-positive, the full suite exposed a pre-existing failure unrelated to that PR.

Failing test

tests/agent/test_anthropic_adapter.py::TestRunOauthSetupToken::test_returns_token_from_credential_files

Error

TypeError: the JSON object must be str, bytes or bytearray, not MagicMock

Call site

agent/anthropic_adapter.py::_read_claude_code_credentials_from_keychain

The mocked subprocess.run result has an unconfigured stdout; result.stdout.strip() returns a MagicMock, which is then passed to json.loads.

Hypothesis

Either:

  1. The test is missing a concrete stdout return-value setup for the mocked keychain subprocess path, or
  2. Production code is reaching keychain credential loading when the credential-files path should short circuit.

Priority

Low priority unless it blocks release or CI gating. The failure is unrelated to the SOUL.md scanner fix.

Error Message

Error

Root Cause

During work on fix/soul-md-scanner-false-positive, the full suite exposed a pre-existing failure unrelated to that PR.

Failing test

tests/agent/test_anthropic_adapter.py::TestRunOauthSetupToken::test_returns_token_from_credential_files

Error

TypeError: the JSON object must be str, bytes or bytearray, not MagicMock

Call site

agent/anthropic_adapter.py::_read_claude_code_credentials_from_keychain

The mocked subprocess.run result has an unconfigured stdout; result.stdout.strip() returns a MagicMock, which is then passed to json.loads.

Hypothesis

Either:

  1. The test is missing a concrete stdout return-value setup for the mocked keychain subprocess path, or
  2. Production code is reaching keychain credential loading when the credential-files path should short circuit.

Priority

Low priority unless it blocks release or CI gating. The failure is unrelated to the SOUL.md scanner fix.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

During work on fix/soul-md-scanner-false-positive, the full suite exposed a pre-existing failure unrelated to that PR.

Failing test

tests/agent/test_anthropic_adapter.py::TestRunOauthSetupToken::test_returns_token_from_credential_files

Error

TypeError: the JSON object must be str, bytes or bytearray, not MagicMock

Call site

agent/anthropic_adapter.py::_read_claude_code_credentials_from_keychain

The mocked subprocess.run result has an unconfigured stdout; result.stdout.strip() returns a MagicMock, which is then passed to json.loads.

Hypothesis

Either:

  1. The test is missing a concrete stdout return-value setup for the mocked keychain subprocess path, or
  2. Production code is reaching keychain credential loading when the credential-files path should short circuit.

Priority

Low priority unless it blocks release or CI gating. The failure is unrelated to the SOUL.md scanner fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Pre-existing failure: test_returns_token_from_credential_files [1 pull requests]