fix(6252): a prompt that names nothing gets no notes menu
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 55s
CI & Build / integration (push) Successful in 1m3s
CI & Build / Python tests (push) Failing after 1m26s
CI & Build / Build & push image (push) Skipped
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 55s
CI & Build / integration (push) Successful in 1m3s
CI & Build / Python tests (push) Failing after 1m26s
CI & Build / Build & push image (push) Skipped
"keep going", "yes please do", "is it deployed?": with no word of its own the
auto-inject query was the previous reply's tail alone, and the menu handed
back the records that reply was built from. In a sample of 59 logged calls,
28 came from short prompts; those with a subject of their own ("continue into
DRY 14", "fix the Windows gate") led with the record meant, while the ones
without were finished tasks already in context, with an open on 2 of about 15.
_has_subject checks the operator's words against a list of words that name
nothing; without one, the ranked menu is skipped and records named by number
are still shown. The prompt rule arm is unchanged and still searches with the
tail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -139,7 +139,7 @@ async def test_a_named_record_comes_first_and_is_not_repeated_as_a_match():
|
||||
other = fake_note(id=11, title="something that matched the words", user_id=1)
|
||||
hits = [(0.80, named), (0.78, other)]
|
||||
out, surfaced, retrieval = await _hint(
|
||||
"go ahead with 4448", hits=hits, records={4448: named},
|
||||
"go ahead with the filing fix in 4448", hits=hits, records={4448: named},
|
||||
)
|
||||
|
||||
ctx = out["context"]
|
||||
@@ -156,6 +156,23 @@ async def test_a_named_record_comes_first_and_is_not_repeated_as_a_match():
|
||||
assert row["suppressed"] == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_prompt_with_no_subject_still_shows_what_it_names():
|
||||
""""go ahead with 4448" names a record and nothing else: the record is
|
||||
looked up and shown, and no ranked menu is searched for."""
|
||||
rec = _task(4448, "the named one")
|
||||
other = fake_note(id=11, title="what the reply was about", user_id=1)
|
||||
out, surfaced, retrieval = await _hint(
|
||||
"go ahead with 4448", hits=[(0.8, other)], records={4448: rec},
|
||||
context="I'll start on the importer next.",
|
||||
)
|
||||
|
||||
assert out["note_ids"] == [4448]
|
||||
assert "Possibly relevant" not in out["context"]
|
||||
assert "auto_inject" not in surfaced
|
||||
retrieval.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_named_record_already_shown_is_a_pointer():
|
||||
rec = _task(4448, "the named one", "a long body that is already in context")
|
||||
|
||||
Reference in New Issue
Block a user