tui: check the model secret parse-only at startup - #169
Open
nishu-builder wants to merge 1 commit into
Open
Conversation
Starting the tui resolved the whole secret store before the first draw: build_secret_store ingests the workspace tree and eval-paths every reader= expression, and resolving DEEP-DEPS/llm-step dispatches real computation — the deepening run re-keyed by any tracked edit, plus rustc worker builds whenever llm-step's inputs (std/llm-*, their tool deps, rust/crates/conversation-protocol) changed. After such a build the tui sat on a blank terminal for the whole compile, ~30s observed, answering a question startup never asked: it only needs to know whether an anthropic-api-key secret is CONFIGURED. Split the store loader instead: load_local_secrets reads specs and values (the transport-free half), local_secret_names exposes it, and the startup checks — model_secret_missing, ensure_conversation_secret, the first-run setup's post-install proof — are parse-only. A malformed spec or unreadable value file still fails at the shell prompt; reader resolution moves to the turn that sends a request, behind the tui's progress UI, where build_secret_store remains the loader. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZgAh1BJk17ge3SasEaCJJ
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.
Stack 1/2 (base for #170 — the sidebar-metadata cache).
Problem
Starting
caos tuiresolved the whole secret store before the first draw:build_secret_storeingests the workspace tree and eval-paths everyreader=expression, and resolvingDEEP-DEPS/llm-stepdispatches real computation — the deepening run re-keyed by any tracked edit, plus rustc worker builds whenever llm-step's inputs (std/llm-*, their tool deps,rust/crates/conversation-protocol) changed. After such a build the tui sat on a blank terminal for the whole compile (~30s observed), answering a question startup never asked: it only needs to know whether ananthropic-api-keysecret is configured.Change
Split the store loader:
caos: newload_local_secrets— the transport-free half ofbuild_secret_store(specs parsed, values read, readers left as the declared expressions) — andlocal_secret_nameson top of it.build_secret_storenow consumes the shared loader, so the two can never disagree on what the store declares.caos-cli:model_secret_missing()andensure_conversation_secret()are parse-only and no longer take a transport;require_model_secretgeneralizes over names. The first-run setup's post-install proof is parse-only too.build_secret_storeremains the loader (conversation_secret_store).Validation
cargo check --workspaceclean;cargo fmt --checkclean; clippy shows only a pre-existingchunks_exactwarning in untouched code.caos(32),caos-clilib (51) and tui bin (138) suites green, including two new tests for the parse-only loader (reads specs/values without resolving readers; fails loudly on a missing value file).nix buildand the saltedrun-tool testgate — no new files orinclude_str!s are added, but worth a salted run before merge.🤖 Generated with Claude Code
https://claude.ai/code/session_01AZgAh1BJk17ge3SasEaCJJ