Fall back to the harness probe when smith can't name a session - #1176
Merged
Conversation
Auto-naming picks its generator by asking whether smith is available at all — a question OAuth-only and Ollama-only machines answer "yes" while title generation on them can only fail. Those users burned their one naming attempt on a doomed one-shot and kept hash names, even though the same-harness probe fallback (spec 0151) was written for exactly them. Ask the narrower question instead: can title generation resolve a model? That means an explicit pin naming a provider it can build, or one of the direct API keys on its own ladder — deliberately narrower than the session-startability check, whose extra rungs spec 0071 records as intentional. Second, a generator that runs and produces nothing no longer ends the attempt. The per-session latch is one-way and only a daemon restart clears it, so a network blip or a revoked key stranded the session on its hash name for the rest of the run. A failed one-shot now hands off to the probe. Generators distinguish "nothing to do" from "produced nothing": a session deleted or renamed by hand mid-flight counts as settled, so the handoff can never overwrite a title the user chose. The feature-status/doctor row for auto-naming moves to the same narrow predicate. It reports on the generator auto-naming actually uses, and reporting Ok off the wider check promised a generator that never runs.
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
Auto-naming has two generators (spec 0151): a cheap smith
--title-modeone-shot, and a hidden same-harness probe session for machines smith can't name. This fixes two ways a session ends up stuck on its hash name anyway.1. The generator choice asked the wrong question. It branched on "is smith available at all" — a check that counts OAuth subscriptions and a reachable Ollama, since those genuinely start smith sessions. Title generation accepts neither: its ladder is direct API keys plus an explicit pin, and the OAuth providers are rejected outright. So an OAuth-only user (the common case: logged-in Codex or Claude CLI, no keys exported) spent their one naming attempt on a one-shot that could only fail, and never reached the probe fallback written for exactly that machine.
Now it asks whether title generation can resolve a model. Deliberately narrower than the session-startability check — that asymmetry is the one spec 0071 records as intentional, and this PR doesn't touch it. A pin naming an OAuth provider is also rejected up front rather than spawning a process that will bail.
2. A failed one-shot consumed the attempt permanently. The per-session latch is one-way and only a daemon restart clears it, so a network blip, a revoked key, or a model refusal left the session unnamed for the rest of the run. Failure now hands off to the probe.
The handoff needs a distinction the code didn't have: "nothing more to do" vs "I produced nothing". Only the second hands off. A session deleted or manually renamed while generation was in flight is the first — otherwise the fallback would spawn a probe to overwrite a title the user chose by hand. There's a test for that specific case.
Slightly beyond the ask
The
doctor/ features-status row for auto-naming also moved to the new predicate. It derives from the same check, and leaving it would have made the PR self-contradictory: doctor reporting "Session auto-naming [ok] — titles generated via smith" on precisely the machines this PR now routes to the probe. The degraded reason is reworded to say what actually happens ("sessions on model harnesses fall back to a one-shot on their own harness; smith and shell sessions keep their default names").The suggestions row deliberately keeps the wider check — suggestions for smith/shell sessions spawn real smith sessions, which OAuth credentials drive fine. That's why this is a new input field rather than a repurposed one.
Not in scope
Teaching title-gen to use OAuth providers directly. That's a real improvement and would give these users the cheap path instead of the probe, but it changes what spec 0071's ladder admits and should be preceded by a spec amendment.
Spec
specs/0151updated: the generator choice keys off what the generator can resolve rather than what a session could start on, and a generator that produces nothing hands off instead of ending the attempt. Spec 0071 needs no change —probe_smithis untouched, so its Non-Goals note about the asymmetry stays accurate.Verification
cargo test -p construct-daemon --lib→ 628 passed, 0 failed. Four new tests:GROK_API_KEY→ false despite being on the wider ladder;codex-oauth:pin → false;openai:pin → true)Binary
This PR only touches
crates/daemon(+ one spec) → relevant binary isconstruct.