Repository navigation
fix(agents): reject empty sessions_search queries in the tool schema - #129120
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 4:50 PM ET / 20:50 UTC (Revision 42). ClawSweeper reviewWhat this changesThe PR adds a non-empty query constraint and keyword description to session search, improves its existing blank-query error, and updates focused tests and generated prompt snapshots. Merge readiness✅ Ready for maintainer review The narrowed repair remains necessary on current main and has no actionable review findings. Recorded exact-head Gateway evidence supports the changed errors and unchanged keyword search; temporal-recall claims have appropriately been removed. Priority: P2 Review scores
Verification
How this fits togetherSession search lets agents find matching text in past conversations. The tool validates keywords, searches through the Gateway within existing session visibility rules, and returns excerpts that can be reopened with session history. flowchart TD
A[Agent keyword query] --> B[Tool input schema]
B --> C[Trim and validate query]
C --> D[Actionable blank-query error]
C --> E[Existing session visibility checks]
E --> F[Gateway transcript search]
F --> G[Matching excerpts and session references]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +22. Total +28 across 6 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep validation and retry guidance in the existing session-search tool, with temporal retrieval improvements handled separately. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main permits an empty string in the tool schema but rejects it during execution. Contributor baseline evidence reports the corresponding failing regression; this review did not execute tests. Is this the best way to solve the issue? Yes. The narrowed patch repairs the existing tool contract and improves recovery without changing retrieval, authorization, configuration, or storage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against aac001b30ba8. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (41 earlier review cycles; latest 8 shown)
|
dd10f1d to
8595c2d
Compare
8595c2d to
f7663f0
Compare
f7663f0 to
13daf63
Compare
|
P1 addressed: the finalizer ( The same gated temporal route is also carried in the prompt tool-summary ( @clawsweeper re-review |
5f1faf0 to
5f32670
Compare
|
@clawsweeper re-review Re-ran the live proof on the exact current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The PR body was replaced at the same head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Full tool-call trace - transcript_events, head 303b24245c0, run 2026-09-10 Re-run on the current head Verbatim read-back from the run's own session store ( |
|
@clawsweeper re-review The remaining P1 item was about retrieval, not content: the full runtime trace was inlined mid-body (~9 KB at offset ~8 KB of a 23 KB description) and the supplied body excerpts could not cover that offset. Changes at the same head
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The branch was rebased onto current The temporal step again routes |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…oral recall to sessions_list Fixes openclaw#129054 Co-Authored-By: Claude <[email protected]>
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Status update to keep this open: the PR is still pending maintainer review - ClawSweeper's latest pass (Sep 12, rev 37) reports no contributor-facing findings, and the branch is unchanged since then. It has drifted behind main and shows merge conflicts; I'll refresh it with a rebase/update-branch when I pick this back up, or earlier if a maintainer wants to look at it now. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
@clawsweeper re-review Updated head: |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Fixes #129054:
sessions_searchadvertises an empty query as valid even though execution cannot use it.Main already rejects blank queries at execution with
query must not be empty; this PR does not claim they previously returned successful search results. It adds the missing schema constraint and actionable retry guidance.Thanks to @brainatworkharris for reporting this and @ruel225 for the fix. All contributor commits and credit are preserved.
User Impact
The model sees a non-empty keyword requirement before calling the tool. Empty or whitespace-only calls that reach execution receive guidance to retry with non-empty keywords. Normal keyword search is unchanged.
Why This Change Was Made
querygainsminLength: 1and the tool-local descriptionRequired non-empty keywords to match in past user and assistant text.query must not be empty; retry with non-empty keywords to match in past session text.minLength: 1but remains rejected by the existing execution guard.No overlap with Pash/Sarah changes.
Prompt-cache footprint
The compact serialized
sessions_searchinput schema grows 368 → 468 UTF-8 bytes (+100). Itsqueryadds only"minLength":1and"description":"Required non-empty keywords to match in past user and assistant text.". The generated tool catalog is otherwise identical to the pinned main baseline, including every tool description. No system-prompt or finalizer guidance change remains. Regenerated readable snapshots change only schema-size accounting (+132 pretty-printed characters, +33 estimated tokens) and derived diff positions.Evidence
9564f57835946776626a314de9613104b3839fb6with the narrowed candidate tests: 18 pass, 3 fail. The schema accepts{query:""}; both provider-normalized execution cases return the old error without retry guidance.789f38cb2266f83a5b8fdad9f40b8b7e6fae4078: 38 focused tests pass (21 search-tool cases and 17 prompt snapshot cases). Empty string fails schema validation, valid keywords pass, and blank/whitespace execution has actionable retry guidance after OpenAI and Google schema normalization.pnpm prompt:snapshots:genregenerated the seven owned fixtures;pnpm prompt:snapshots:checkreports current (7 files). Tool catalog comparison proves no change outside thequeryschema.POST /tools/invokeforquery:""andquery:" "returns HTTP 400 withquery must not be empty; retry with non-empty keywords to match in past session text. The keyword control returns the same expected session, assistant role, apricot-launch text, and score as baseline (only synthetic IDs/timestamps differ). This exercises the real error-result path without assuming OpenAI enforces schema constraints.The existing real Gateway baseline shows empty and whitespace-only calls returning HTTP 400 with the old error;
ORCHARD129054returns the seeded apricot-launch message. That is the baseline execution behavior, not a successful empty-query search.Historical real-model evidence from the preceding head is reused, not claimed as an exact-head rerun: four
gpt-5-minirequests total across baseline/candidate turns; the candidate emitted a non-empty query but did not retrieve the seeded temporal topics. No additional provider requests are needed to prove this narrowed schema/error change.