Repository navigation
Keep the procedure lane on a lookup that names a change (refs #3784) - #3821
Conversation
Review: PR #3821 (issue #3784, lookup keeps the procedure lane)Verdict: COMMENT (no blockers; two findings worth a decision before merge). Findings🟡 packages/agent/src/local_agent/routing.rs:452-453 ( 🟡 routing.rs:1588 ( 🟢 routing.rs:1597: a kept procedure that clears the gate now makes 🟢 Tests: 🟢 Standards: no lint suppression, no compat code, no node_type or lifecycle literals; Nit: routing.rs:1565-1569: the doc comment embeds measured scores (1.07 vs 0.87) that go stale when skills or the embedding model change, and the user's eval sentence. State the mechanism and point to the issue for the numbers. Requirements checkFixes the lookup-path hop recorded on #3784 ( Recommendation: COMMENTSafe enough to land as a partial fix; address or consciously accept the |
malibio
left a comment
There was a problem hiding this comment.
Review: PR #3821 (issue #3784, lookup keeps the procedure lane)
Verdict: COMMENT (no blockers; two findings worth a decision before merge).
Findings
🟡 packages/agent/src/local_agent/routing.rs:452-453 (answer/answered in WRITING): false positives on read questions. The list is read by is_lookup_shaped's question-word branch (line 346), lookup_without_stage1 (line 543) and decision_for_an_offered_option (line 581), not only by the new flag. "What did Anoop answer?" or "Which questions have been answered?" now (a) skips the no-Stage-1 lookup shortcut and pays a Stage 1 call, (b) loses the question-word lookup shape when there is no ?, and (c) once Stage 1 does call it a lookup, asks_for_a_change is true and the write-tool procedure (Answering a Question) is kept on what is a pure read. answer is both noun and verb, unlike the other words in the list. Suggest either a narrower trigger (answer only as a verb: after "get"/"have"/"it", or adjacent to "it"/"them"), or accepting it knowingly and adding negative tests for these phrasings in lookup_without_stage1 and is_lookup_shaped. The existing doc says a miss costs little, but a false positive here costs routing of a read.
🟡 routing.rs:1588 (read_only_candidates): the new branch sits before the pinned branch and returns the candidate with its write tools intact. A pinned Procedure on a lookup that names a change previously had its write tools stripped (ADR-090 §5, "a turn that only reads cannot write through it"); now it keeps them. Also the kept procedure's write tools reach Stage 2 unfiltered on a turn Stage 1 called a lookup, so any destructive tool in its whitelist is exposed on the strength of one word match. Consider ordering the check after the pinned case or stripping destructive tools, and state in the doc comment which is intended. No test covers pinned + asked_for_a_change = true.
🟢 routing.rs:1597: a kept procedure that clears the gate now makes read_only.iter().any(clears_score_gate) true, so the "nothing read-only clears the gate, keep what was retrieved" fallback no longer fires when only the procedure clears. Probably fine, but untested: add a case with a non-clearing read skill plus a clearing procedure.
🟢 Tests: asks_for_a_change is tested on two sentences only. Missing: "then"-style false positives on lookups ("find X, then show Y" was already a write), answer as a noun, and the agent_loop wiring (flag passed from the user message, not the blended query). The read_only_candidates unit test is good.
🟢 Standards: no lint suppression, no compat code, no node_type or lifecycle literals; WRITING length bumped to 39 correctly. asks_for_a_change duplicates the word-splitting block already repeated at lines 536-541 and 575-580; a small words_of(message) helper would remove three copies (Nit).
Nit: routing.rs:1565-1569: the doc comment embeds measured scores (1.07 vs 0.87) that go stale when skills or the embedding model change, and the user's eval sentence. State the mechanism and point to the issue for the numbers.
Requirements check
Fixes the lookup-path hop recorded on #3784 (answer-asks-user 0/3 to 3/3); explicitly leaves the other scenarios open, matching the issue's hop table. Scope is atomic.
Recommendation: COMMENT
Safe enough to land as a partial fix; address or consciously accept the answer/answered blast radius and the pinned-procedure write-tool exposure first.
|
Addressed the review (commit on the branch):
|
Re-review: PR #3821 (commits 04f84db..efafe7b)Verdict: APPROVE (no blockers; one small false-positive worth a follow-up in this PR if cheap). Earlier findings
New findings🟡 packages/agent/src/local_agent/routing.rs ( Nits you skipped
Recommendation: APPROVE |
malibio
left a comment
There was a problem hiding this comment.
Re-review: PR #3821 (commits 04f84db..efafe7b)
Verdict: APPROVE (no blockers; one small false-positive worth a follow-up in this PR if cheap).
Earlier findings
- answer/answered blast radius: addressed.
WRITINGis back to its original list, sois_lookup_shaped,lookup_without_stage1anddecision_for_an_offered_optionread exactly what they did before. The new check lives only inasks_for_a_change. Negative tests cover the noun phrasings. - Pinned procedure: addressed. The
pinnedbranch now runs first and strips write tools; the new test asserts["run_query"]with the flag true. An unpinned procedure keeps its tools only when the flag is set androle == Procedure. - Fallback: addressed and tested (clearing procedure + non-clearing read skill, flag true and false). The behaviour is reasonable: with a change named, the lookup narrows to read skills plus the procedure, and the clearing procedure satisfies the gate. Side effect worth knowing: a high-scoring write tool skill (Node Deletion 0.99) is dropped in favour of a 0.01 read skill. That is the intended read-only narrowing, not a regression.
- Doc comment: addressed (mechanism stated, numbers moved to the issue).
New findings
🟡 packages/agent/src/local_agent/routing.rs (asks_for_a_change, get/got ... answered): the "got" arm false-positives on realistic reads: "What questions got answered yesterday?", "Get all answered questions", "Get the answered questions". Each has get/got followed within 3 words by answered. The effect is mild (an unpinned write-tool procedure is kept on a lookup), but it re-opens the exact class the earlier finding closed. Suggest requiring the object pronoun: get|got|have + (it|them|this|that) then answered, and drop got or require it. Add "What questions got answered?" and "Get the answered questions" to answer_as_a_noun_or_a_read_names_no_change.
🟢 False negatives: "Find the question and answer it", "I need to answer Anoop's question" are missed because only a leading answer counts. Consistent with the documented "a miss is cheap" stance; acceptable.
🟢 split_request_opening is private and the new public fn is reached only via the one call site; fine.
Nits you skipped
words_ofhelper: agree, defer; now four copies is the point to extract (this one plus the two existing ones plusis_lookup_shapedcallers), so do it with the next touch.- Wiring test for
user_message: agree. One expression at the call site; low value. Note the flag reads the raw user message, not the blended query, which is correct.
Recommendation: APPROVE
|
Addressed the re-review (one commit):
routing tests: 152 passed; Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: the reviewer recommended APPROVE; the only change since is the one tightening the reviewer asked for, a single added condition with tests, no new behaviour. The eval sentence ("get it answered") still matches. |
A lookup narrows to read-only skills, which dropped the lane's procedure even when the user's own message asked for a change: 'take the question that is waiting on me and get it answered' ranked Answering a Question first (1.07 against 0.87) and the model never saw it. A message that names a change now keeps the lane's procedure; the tool skills are still narrowed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…write tools off (refs #3784) - 'answer'/'answered' leave the shared write-verb list (they are nouns in reads); asks_for_a_change recognises a command to answer or 'get it answered' on its own, so no question shape changes. - A pinned procedure is handled by the pinned rule before the new one, so it still loses its write tools on a lookup (ADR-090 section 5). - Tests: pinned + flag, a clearing procedure beside a non-clearing read skill, noun uses of 'answer'. - Doc comment states the mechanism and drops the measured scores. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
'got answered' and 'get the answered questions' are reads. The arm now needs get/got + it/them/this/that before 'answered'. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1fed426 to
c5d5a7a
Compare
What
read_only_candidatestakes a flag: when the user's own message names a change (asks_for_a_change, built on the existing closedasks_for_a_writelist, now withanswer/answered), the lane's procedure is kept on a lookup turn. The tool skills are narrowed as before.Measured (E4B, isolated daemon, DB purged between reps,
--runs 3)answer-asks-user: 0/3 → 3/3declined-request: 3/3 (PR Hold a task create while a recorded decision may settle it (refs #3784) #3807)bug-not-reproducible: 2/3;bug-created-ready,bug-diagnosed,question-blocks-task: 0/3Tried and not kept
use_for,not_for): moved scores by under 0.03 and lowered Creating a Task on its own prompt. Reverted.eval:tasksaggregate (2.67/6), longer prompts and several turns at the 180s limit. Reverted.Findings per hop are on the issue; #3784 stays open for the remaining scenarios.
🤖 Generated with Claude Code