Repository navigation
fix(tui): restore the build after local Ollama discovery landed - #7129
Merged
Hmbown merged 2 commits intoOct 29, 2026
Merged
Conversation
`cargo build` and the Lint gate have been failing on main since the local Ollama discovery and interrupted-session landings, so every pull request built on current main is red before it is reviewed. This makes main compile and lint again. The compile error was a lifetime mismatch in `fetch_tag_profiles`: the per-tag async block borrowed `&String` from the caller's slice, so the stream's item type carried a caller lifetime that `tokio::spawn` could not satisfy. It now owns a `String`, which keeps the bounded-concurrency probing and its ordering unchanged. Annotating the closure argument, as the compiler suggests, does not fix it. The two remaining errors were lints denied by the workspace `-D warnings`: a redundant `return` and a unit value passed to `Some`. Both keep their existing behavior. Verified on macOS with the locked workspace: `cargo fmt --check`, `clippy --all-targets --all-features` with the CI allowances, a full `codewhale-cli` build, and the client, local_ollama and session_manager suites. Two failures that reproduce on unmodified main are left alone: session_manager's interrupted-deletion test, and intermittently failing socket-bound tests in the client suite. Signed-off-by: Ben Gao <bengao168@msn.com>
Keep the contributor build fix while following the workspace policy for new code comments.
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.
What and why
maindoes not compile right now, so every PR built on it is red before review. This fixes the three errors that block it.The compile error.
fetch_tag_profileshiterror: implementation of `FnOnce` is not general enoughthrough three call sites (client.rs::fetch_catalog_delta,client.rsroute sweep,local_ollama.rs::spawn_local_ollama_adoption_probe). Since 7c49574 the per-tag async block borrows&Stringout of the caller'stagsslice, so the stream's item type carries a caller lifetime andtokio::spawncannot accept it. The function now owns anStringper candidate; bounded concurrency (SHOW_PROBE_LIMIT) and result ordering are unchanged.Worth knowing for anyone who hits this: the compiler's
help: consider adding an explicit type annotation to the closure's argument(|tag: &String|) does not fix it — I checked that suggestion in isolation and it still fails.The two lints. Denied by the workspace
-D warnings:session_manager.rs:save_checkpointis only called from tests since the persistence path moved tosave_checkpoint_owned(3016ef4). Gated#[cfg(test)]rather than suppressed, so it adds no dead-code-suppression budget.session_manager.rs: a redundantreturn.provider_routes.rs:Some(apply_route())called the closure insideSome; now called as a statement.No behavior changes intended.
Issue
No-Issue: main build breakage from direct-to-main landings; there is no tracking issue and CI does not run on pushes to main.
How I tested it
macOS, locked workspace,
scripts/dev-cargo.shandscripts/dev-test.sh:cargo fmt --all -- --check— clean.clippy -p codewhale-tui --all-targets --all-features --locked -- -D warnings -A clippy::uninlined_format_args -A clippy::too_many_arguments -A clippy::unnecessary_map_or— clean.build -p codewhale-cli --locked— succeeds;./target/debug/codewhale --versionprintscodewhale 0.10.2 (dev).scripts/dev-test.sh crates/tui/src/local_ollama.rs— 9 passed.scripts/dev-test.sh crates/tui/src/tui/ui/— 4027 passed (provider_routes path).scripts/dev-test.sh crates/tui/src/client/— 621 passed on the earlier run.scripts/dev-test.sh crates/tui/src/session_manager.rs— 135 passed, 1 failed (see below).Two failures are pre-existing on unmodified main, and I left them alone to keep this one focused. Each was reproduced with my patch stashed, on
687a38c6e:session_manager::tests::interrupted_session_deletion_keeps_recovery_incomplete_and_can_finish— deterministic. It writes a legacy checkpoint, assertsload_legacy_checkpoint()isNone(the origin is retired), then expectsdelete_sessionto finish the interrupted cleanup. The explicit-delete guard added in fed2140 (this session has a shared legacy checkpoint; remove that checkpoint separately) refuses instead. Test and guard disagree about that case.mcp::http_client::tests::model_added_endpoint_cannot_use_ambient_proxy_but_operator_can,client::tests::create_message_scenario) — intermittent. Baseline runs on clean main failed 1 in 3 with the same "Connection failed" / unexpectedlistener.accept()assertions. Each passes when run alone.So
Test (ubuntu-latest)may still be red on this PR for reasons unrelated to it. Happy to take either failure in a follow-up if you want them.Not verified: Windows and the OpenHarmony build;
cargo-nextestis not installed here, so I used the libtest harnessscripts/dev-test.shselects when nextest is absent.Checklist
main(no need to rebase whenmainmoves)cargo fmt --allpasses, and tests cover new or changed behaviordocs/features.toml(cargo test -p codewhale-tui --test feature_registrychecks it)