refactor: Hoist search-actors guidance strings to builders#1075
Draft
jirispilka wants to merge 1 commit into
Draft
refactor: Hoist search-actors guidance strings to builders#1075jirispilka wants to merge 1 commit into
jirispilka wants to merge 1 commit into
Conversation
What we're solving: two LLM-guidance strings for the search-actors tool
were duplicated and get tuned often. The empty-results "broaden your
search" text was byte-identical in search_actors.ts and the widget, and
the results footer/instructions was written twice inside search_actors.ts,
differing only by "please use" vs "use". Editing the guidance meant
changing several near-identical copies by hand.
How: add two exported builders to search_actors.ts (next to the existing
buildSearchActorsResult that the widget already imports) —
buildNoActorsFoundInstructions(keywords) and
buildSearchActorsFooter(verbatimLinksNudge). All four inline copies now
call them. The two footer copies collapse to one wording ("use ..."),
dropping "please" from the structured instructions field.
Alternatives considered: a new shared strings file (rejected —
search_actors.ts is already the shared source the widget imports from);
keeping the two footer copies separate (rejected — defeats the dedup).
The wording unification only affects LLM-facing guidance prose, not any
machine-parsed field; existing unit tests assert stable substrings and
pass unmodified.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016pXZvhEoE6Lz3DpBSL3n1Y
9 tasks
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.
Part of #1066 (checkbox: hoist search-actors guidance strings).
What we're solving
Two LLM-guidance strings for the search-actors tool were duplicated, and they get tuned often:
search_actors.tsandsearch_actors_widget.ts.search_actors.ts(the structuredinstructionsfield and the text footer), differing only by "please use" vs "use".Editing the guidance meant changing several near-identical copies by hand.
How
Add two exported builders to
search_actors.ts, next to the existingbuildSearchActorsResultthat the widget already imports:buildNoActorsFoundInstructions(keywords)— used by both the default tool and the widget empty-results branches.buildSearchActorsFooter(verbatimLinksNudge)— used by both footer copies insearch_actors.ts.All four inline copies now call the builders. The two footer copies collapse to one wording ("use …"), dropping "please" from the structured
instructionsfield.Alternatives considered
search_actors.tsis already the shared source the widget imports from.Note
The wording unification only affects LLM-facing guidance prose, not any machine-parsed field. The existing search-actors unit tests assert stable substrings and pass unmodified.
Verification
test:unit959 passed / 2 skipped (search-actors default + widget response tests: 10 passed), format no-op.🤖 Generated with Claude Code
https://claude.ai/code/session_016pXZvhEoE6Lz3DpBSL3n1Y
Generated by Claude Code