Repository navigation
feat(skill-reco): lock the composer for the wait, and give it 3 s - #807
Merged
Merged
Conversation
Two halves of the same complaint: the recommendation looked like it wasn't firing at all. **The budget was too tight.** Jev's measured latency is p50 ≈0.5 s but p95 ≈1.4 s (`docs/internals/skill_reco/evaluation.md`), so a 1.5 s deadline discarded one answer in twenty — and a discarded answer is indistinguishable from "no skill fits" on screen: no card, no message, the draft just sends. Live evidence from tonight's agent log: two calls answered in 1691 ms and 1551 ms for the same question, both past the deadline, both thrown away. The budget is now **3 s** on all three clients. **The wait was invisible.** The desktop already refused to submit while the recommender was being asked, but only through a ref: the input stayed editable, the send button kept its normal look, and pressing it did nothing. Now the wait is shown, on every client: - desktop: the editor is locked (so the text that goes out is the text that was evaluated) and the send button is disabled with a spinner and a 「正在匹配技能…」 status line, mirroring how manual compaction already reports itself. - mobile: the hook exposes `evaluating`; the dock turns the send button into an `ActivityIndicator`, refuses the submit, and closes the input for the same window. - TUI: the prompt line spins (`⠋ Looking for a skill that fits…`) and the box is locked — typing, paste and Escape all leave the held draft alone. This also fixes a real bug: a second Enter used to fall through to the normal send path, so the message the answer belonged to went out while the answer was still in flight, and a card for it could land afterwards. The lock covers the network wait only — the local daily-budget and candidate reads before it are fast and must not flash the input disabled. It ends as soon as the answer does, so a declined recommendation still sends the draft unchanged. Tests: desktop `Composer.skillRecommend.test.tsx` drives the pending window (editor not editable, send disabled + labelled, nothing sent) and the follow-up send — verified to fail against the previous `Composer.tsx`. Hook suites cover the 3 s budget (fake-timer timeout at `RECOMMEND_TIMEOUT_MS`) and the mobile `evaluating` flag; mobile `ComposerDock.test.ts` covers the locked dock and was likewise checked to fail without the change. TUI: the pending line spins, and `a_pending_recommendation_locks_the_input_box` covers Enter/typing/paste/Escape. Green locally: desktop 144 files / 1250 tests, mobile 123 / 1870, TUI 2090 lib + 8 + 5 integration tests, clippy clean. Not changed: the shown-card state (`Suggested`) stays editable on all three — the card is actionable there, and only then does the draft wait on a human.
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.
feat(skill-reco): lock the composer for the wait, and give it 3 s
Two halves of the same complaint: the recommendation looked like it wasn't
firing at all.
The budget was too tight. Jev's measured latency is p50 ≈0.5 s but
p95 ≈1.4 s (
docs/internals/skill_reco/evaluation.md), so a 1.5 s deadlinediscarded one answer in twenty — and a discarded answer is indistinguishable
from "no skill fits" on screen: no card, no message, the draft just sends. Live
evidence from tonight's agent log: two calls answered in 1691 ms and 1551 ms for
the same question, both past the deadline, both thrown away. The budget is now
3 s on all three clients.
The wait was invisible. The desktop already refused to submit while the
recommender was being asked, but only through a ref: the input stayed editable,
the send button kept its normal look, and pressing it did nothing. Now the wait
is shown, on every client:
evaluated) and the send button is disabled with a spinner and a
「正在匹配技能…」 status line, mirroring how manual compaction already reports
itself.
evaluating; the dock turns the send button into anActivityIndicator, refuses the submit, and closes the input for the samewindow.
⠋ Looking for a skill that fits…) and the box islocked — typing, paste and Escape all leave the held draft alone. This also
fixes a real bug: a second Enter used to fall through to the normal send path,
so the message the answer belonged to went out while the answer was still in
flight, and a card for it could land afterwards.
The lock covers the network wait only — the local daily-budget and candidate
reads before it are fast and must not flash the input disabled. It ends as soon
as the answer does, so a declined recommendation still sends the draft
unchanged.
Tests: desktop
Composer.skillRecommend.test.tsxdrives the pending window(editor not editable, send disabled + labelled, nothing sent) and the follow-up
send — verified to fail against the previous
Composer.tsx. Hook suites coverthe 3 s budget (fake-timer timeout at
RECOMMEND_TIMEOUT_MS) and the mobileevaluatingflag; mobileComposerDock.test.tscovers the locked dock and waslikewise checked to fail without the change. TUI: the pending line spins, and
a_pending_recommendation_locks_the_input_boxcovers Enter/typing/paste/Escape.Green locally: desktop 144 files / 1250 tests, mobile 123 / 1870, TUI 2090 lib +
8 + 5 integration tests, clippy clean.
Not changed: the shown-card state (
Suggested) stays editable on all three —the card is actionable there, and only then does the draft wait on a human.