Repository navigation
Commit 6456db7
fix: Report an empty search-actors page past the last result as such (#1568)
## Why
Closes #1276
Review page with before/after examples for this PR and the five related
ones (#1563–#1567): https://claude.ai/artifact/WDRj1nwPnMTP9ktGyg3z3i
Reported by @lokicik. This follows the implementation spec in the
maintainer comment on the issue.
`search-actors` returned the no-match guidance ("Keywords can include …
A platform-only query such as "TikTok" …") for any empty page, including
a page past the last result of a query that matched. With an empty query
that advice cannot help, and it reads as if nothing matched.
## What changed
`buildNoActorsFoundInstructions()`, shared by `search-actors` and
`search-actors-widget`, now gets the offset. With `offset > 0` it
returns one sentence and no keyword advice; at `offset` 0 the text is
unchanged. No new response fields; the output schema is unchanged. This
is a tool-text change to `structuredContent.instructions` and the text
content.
`search-actors` with `keywords: "", limit: 1, offset: 1000000`:
```
Before: No Actors were found for the search query "".
Keywords can include the named platform and/or data type (e.g. "TikTok posts").
A platform-only query such as "TikTok" is an option if more specific results do not fit.
Now: No Actors past offset 1000000 for the search query "".
```
## Notes for reviewers (human-written)
## Proof it works
mcpc with the Claude connector tool set on this branch:
| `search-actors` call | Result |
|---|---|
| `keywords: "", limit: 1, offset: 0` | 1 Actor |
| `keywords: "", limit: 1, offset: 1000000` | `No Actors past offset
1000000 for the search query "".` |
| `keywords: "instagram scraper", limit: 5, offset: 5000` | `No Actors
past offset 5000 for the search query "instagram scraper".` |
| `keywords: "zzqqxxnotarealactorkeyword123", offset: 0` | the
three-line no-match guidance, unchanged |
The text content equals `structuredContent.instructions`, and
`structuredContent` keeps its fields (`actors: []`, `query`, `count: 0`,
`instructions`). The same `offset: 1000000` call on a build with
master's text returns the three-line guidance shown under "Before".
Unit tests (failing before the fix): an empty page at `offset` 1 returns
the new sentence in `structuredContent` and the text content, for both
`search-actors` and `search-actors-widget`. The existing
empty-first-page tests keep the three-line text.
Implemented with Claude Code: code, tests, mcpc probe and this
description. Reviewed by a separate Claude Code review pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_0149C4bPjve1UHWcxTtBsPXC
---
_Generated by [Claude
Code](https://claude.ai/code/session_0149C4bPjve1UHWcxTtBsPXC)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3a5570d commit 6456db7
4 files changed
Lines changed: 45 additions & 4 deletions
File tree
- src/tools
- actors
- widgets
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | | - | |
| 130 | + | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
210 | | - | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
190 | 208 | | |
191 | 209 | | |
192 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
118 | 139 | | |
119 | 140 | | |
120 | 141 | | |
| |||
0 commit comments