Repository navigation
Description
Summary
The Run TUI library tests (Linux only) step has been failing on every master push since 5c70ac4c3 (2026-07-27T05:08). It is one test, and it is the only failure in the job — 2046 passed; 1 failed in the latest run. The test has never passed: its fixture leaves ProviderAuth::state at AuthState::NotConfigured, which is a state build_auth_status_lines deliberately renders as "no credentials".
Run 30413583952 (8fc780bda), identical in 30321258860 and every run in between:
---- tui::ui::header::tests::header_provider_auth_tag_prefers_app_resolved_credential_over_env stdout ----
panicked at crates/jcode-tui/src/tui/ui_header.rs:1469:9:
rendered: ○ anthropic○ openrouter○ openai○ cursor○ copilot○ gemini○ antigravity
test result: FAILED. 2046 passed; 1 failed; 16 ignored; 0 measured; 8 filtered out
That rendered string is the tell: seven providers, all hollow dots, no (...) method suffix — the fallback full list, i.e. nothing was considered configured.
Root cause
The fixture at ui_header.rs:1448 sets the two credential booleans but not state:
let both = AuthStatus {
anthropic: ProviderAuth {
has_oauth: true,
has_api_key: true,
..Default::default() // state: AuthState::NotConfigured
},
..AuthStatus::default()
};AuthState's #[default] is NotConfigured (crates/jcode-auth-types/src/lib.rs:11), and two things then key off it:
provider_label(ui_header.rs:322) returns the bare name forNotConfigured, discarding theoauth+key*method thatdual_method_labelcorrectly computed — so the label isanthropic, notanthropic(oauth+key*).build_auth_status_lines(ui_header.rs:400) filtersNotConfiguredout, finds the result empty, and falls back to the full seven-provider list.
The first assertion in the test passes because header_provider_auth_tag reads only has_oauth/has_api_key/the override and ignores state. Only the render path needs it.
Why the fixture is wrong, not the code
has_oauth: true with state: NotConfigured is unreachable in production. probe_anthropic_status sets both together (crates/jcode-base/src/auth/mod.rs:986-1001): OAuth sets Available or Expired, an API key forces Available.
The contrast is in the same file and the same CI run: auth_status_line_marks_active_credential_when_both_configured (ui_header.rs:1686) asserts the identical anthropic(oauth+key*) string through build_auth_status_lines, and it passes — because its fixture sets state: AuthState::Available. So does auth_status_lines_show_all_providers_with_state_dots (:1645, Expired). The failing test is the only one that renders while using the tag-only fixture shape from :1485/:1528.
Timeline
The NotConfigured filter arrived in 6f17b11e9 (2026-07-25, from #582) and correctly updated the one render test that existed then. The failing test was added two days later, in 5c70ac4c3, alongside the ActiveCredentialOverrides parameter — it copied the fixture from the neighbouring tag-only tests, which do not need state. Nothing regressed; the test was born red.
It shows up only on Linux because Run TUI library tests is if: runner.os == 'Linux' — macOS and Windows stop at --lib --bins --no-run, so this is the sole gate that executes it (the point of #592).
Fix
Match the fixture that already works at :1686:
let both = AuthStatus {
anthropic: ProviderAuth {
state: AuthState::Available,
has_oauth: true,
oauth_state: AuthState::Available,
has_api_key: true,
},
..AuthStatus::default()
};Worth considering separately: provider_label silently dropping a computed method suffix means any future state/has_* skew renders as "unconfigured" rather than failing loudly. A debug assertion that has_oauth || has_api_key implies state != NotConfigured would have caught this at the fixture instead of in a string comparison.
Environment
No Rust toolchain on this machine, so I did not run the suite — the failure and the rendered: output are from the CI logs above, and the analysis is against 8fc780bda, the same commit that run tested. Every line reference is on that commit.
Activity
1jehuang commentedon Jul 29, 2026
Confirmed, and your analysis was correct in every particular, including that the test was born red rather than regressing.
Fixed in #656 by setting
state: AuthState::Availableandoauth_state: AuthState::Availablein the fixture, matching the one at:1686that already passes.cargo test -p jcode-tui --lib header_provider_auth_tagnow passes all three tests.Your follow-up point is the more valuable one and I did not fold it into this PR, deliberately: a debug assertion that
has_oauth || has_api_keyimpliesstate != NotConfiguredis a real behavior change with its own blast radius across the auth probes, and it deserves its own review rather than riding along with a one-line fixture fix. Leaving it for the maintainer to weigh separately.--- — Jcode agent (automated triage), on behalf of @1jehuang
1jehuang commentedon Jul 29, 2026
Confirmed green in CI: on this run the
Run TUI library tests (Linux only)step passes, where it failed on the last master run and every push since5c70ac4c3.One side effect worth recording here, since you traced the CI history: that job used to abort at this test, which meant the later
Security preflightstep never ran. With the test fixed, the job reaches it and it fails on a pre-existingtract-nnefadvisory. Unrelated to your issue and not introduced by the fix, but it was hidden behind this failure and now needs its own decision.--- — Jcode agent (automated triage), on behalf of @1jehuang
1jehuang commentedon Jul 29, 2026
Fixed in #663 (verified on CI).
Your diagnosis was exactly right, including the detail that made it obvious: the sibling test
auth_status_line_marks_active_credential_when_both_configuredsetsstate: Availableon the same shape of fixture. The failing one claimedhas_oauth + has_api_keywhile leavingstateatNotConfigured, which no real probe can produce, sincestateis the best of the available methods.build_auth_status_linesfilters onstate, so it rendered the nothing-configured fallback instead ofanthropic(oauth+key*).Confirmed on the CI run for #663: the
Run TUI library tests (Linux only)step now passes, 2053 tests, which is the gate that had been red since5c70ac4c3.One note in case it matters to you: this test was fixed as part of a larger CI-restoration branch rather than on its own, because master had four other independent failures stacked behind the rustfmt step (tracked in #662). Landing this alone would not have turned the job green.
Leaving this open until #663 merges.
--- — Jcode agent (automated triage), on behalf of @1jehuang
LuShadowX commentedon Jul 30, 2026
Thanks for the confirmations here, and for saying plainly which parts of the diagnosis held up.
One direct question, because it decides whether I keep spending time on this repo: is there any path to a change of mine landing as a commit? I've read the PR policy and I understand the reasoning — you maintain the result, so you write it. In practice that means the work lands as your commit and I stay a reporter, which is a reasonable arrangement for you and not one that works for me.
If that's the answer, genuinely no hard feelings. It's your project, the policy is published, and you've been faster and more precise in review than most repos manage. I'd just rather put the hours somewhere a patch of mine can land, so I'll step away from this one.
Good luck with the CI restoration in #663.
fix: five triage fixes for Gemini schemas, macOS stdin, reload, MCP m…
fix: five triage fixes for Gemini schemas, macOS stdin, reload, MCP m…
fix: five triage fixes for Gemini schemas, macOS stdin, reload, MCP m…
fix: five triage fixes for Gemini schemas, macOS stdin, reload, MCP m…
fix: five triage fixes for Gemini schemas, macOS stdin, reload, MCP m…
fix: five triage fixes for Gemini schemas, macOS stdin, reload, MCP m…
fix: five triage fixes for Gemini schemas, macOS stdin, reload, MCP m…