Skip to content

fix(agents): reject empty sessions_search queries in the tool schema - #129120

Merged
obviyus merged 3 commits into
openclaw:mainfrom
ruel225:fix/sessions-search-empty-query-129054
Oct 2, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
ruel225:fix/sessions-search-empty-query-129054

Conversation

@ruel225

@ruel225 ruel225 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #129054: sessions_search advertises 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

  • query gains minLength: 1 and the tool-local description Required non-empty keywords to match in past user and assistant text.
  • The existing trimmed-query executor guard remains; its error becomes query must not be empty; retry with non-empty keywords to match in past session text.
  • Whitespace-only text satisfies minLength: 1 but remains rejected by the existing execution guard.
  • Time-range guidance is deferred. The earlier live-model comparison did not demonstrate temporal routing or successful recall. Its system-prompt summary and cross-tool description additions have been removed, together with their tests. No new system-prompt guidance is retained.

No overlap with Pash/Sarah changes.

Prompt-cache footprint

The compact serialized sessions_search input schema grows 368 → 468 UTF-8 bytes (+100). Its query adds only "minLength":1 and "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

  • Baseline 9564f57835946776626a314de9613104b3839fb6 with the narrowed candidate tests: 18 pass, 3 fail. The schema accepts {query:""}; both provider-normalized execution cases return the old error without retry guidance.
  • Narrowed candidate 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:gen regenerated the seven owned fixtures; pnpm prompt:snapshots:check reports current (7 files). Tool catalog comparison proves no change outside the query schema.
  • Exact-head Linux/Node 24.16 build and real Gateway smoke pass. POST /tools/invoke for query:"" and query:" " returns HTTP 400 with query 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; ORCHARD129054 returns 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-mini requests 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.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@ruel225
ruel225 marked this pull request as ready for review August 25, 2026 07:35
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Aug 25, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 4:50 PM ET / 20:50 UTC (Revision 42).

ClawSweeper review

What this changes

The 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
Reviewed head: 789f38cb2266f83a5b8fdad9f40b8b7e6fae4078

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant real Gateway evidence, baseline-failing regressions, and no actionable correctness or security findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured exact-head Linux Gateway run exercises the changed session-search executor through POST /tools/invoke: blank inputs return the new retry guidance and a seeded keyword control preserves results. Schema regressions supplement this proof; the limited historical model run is not used to claim temporal-recall success. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured exact-head Linux Gateway run exercises the changed session-search executor through POST /tools/invoke: blank inputs return the new retry guidance and a seeded keyword control preserves results. Schema regressions supplement this proof; the limited historical model run is not used to claim temporal-recall success. No stored-data contract changes.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head diff changes only query metadata, the existing rejection message, focused regression coverage, and derived snapshots. No temporal system-prompt or tool-description change remains.
Still necessary on current main: Fetched main still declares query with maxLength alone. The tool file is unchanged between the pinned baseline and fetched main, so the missing schema constraint remains. Latest-release blob inspection was unavailable; no shipped-fix claim is made.
Whitespace and provider compatibility: String parameters are trimmed by default before the unchanged executor guard rejects blank input. OpenClaw's Google schema cleaner strips minLength, making the retained execution guard important. The normalization owner is target-repository packages/ai; generated Codex fixture names do not establish a dependency on sibling Codex runtime behavior.
Findings None None.
Security None None.

How this fits together

Session 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +6, Tests +22. Total +28 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 2 +6
Tests 5 46 24 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 54 26 +28

Review metrics

Metric Value Why it matters
Model-facing schema footprint +100 compact UTF-8 bytes; +132 readable characters The recorded prompt cost is bounded to query metadata, with no retained system-prompt expansion.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #129054
Summary: This PR addresses the linked report's query-schema mismatch; temporal retrieval remains separate.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded tool-input contract mismatch while ordinary keyword search remains available.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured exact-head Linux Gateway run exercises the changed session-search executor through POST /tools/invoke: blank inputs return the new retry guidance and a seeded keyword control preserves results. Schema regressions supplement this proof; the limited historical model run is not used to claim temporal-recall success. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-head Linux Gateway run exercises the changed session-search executor through POST /tools/invoke: blank inputs return the new retry guidance and a seeded keyword control preserves results. Schema regressions supplement this proof; the limited historical model run is not used to claim temporal-recall success. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff changes only query metadata, the existing rejection message, focused regression coverage, and derived snapshots. No temporal system-prompt or tool-description change remains. (src/agents/tools/sessions-search-tool.ts:53, 789f38cb2266)
  • Still necessary on current main: Fetched main still declares query with maxLength alone. The tool file is unchanged between the pinned baseline and fetched main, so the missing schema constraint remains. Latest-release blob inspection was unavailable; no shipped-fix claim is made. (src/agents/tools/sessions-search-tool.ts:53, aac001b30ba8)
  • Whitespace and provider compatibility: String parameters are trimmed by default before the unchanged executor guard rejects blank input. OpenClaw's Google schema cleaner strips minLength, making the retained execution guard important. The normalization owner is target-repository packages/ai; generated Codex fixture names do not establish a dependency on sibling Codex runtime behavior. (packages/ai/src/providers/clean-for-gemini.ts:22, 789f38cb2266)
  • Focused regression coverage: Added cases validate empty-string rejection and valid keywords, then exercise blank execution after OpenAI and Google normalization. The captured body reports three baseline failures and 38 candidate passes across search-tool and snapshot cases. Tests were inspected, not executed during this read-only review. (src/agents/tools/sessions-search-tool.test.ts:206, 789f38cb2266)
  • Exact-head real Gateway proof: The captured PR body records a Linux/Node 24.16 run built from the reviewed head: POST /tools/invoke returned HTTP 400 with the new retry guidance for empty and whitespace queries, while the keyword control preserved the expected session, assistant role, apricot-launch text, and score. The requested-focus comment corroborates this scope: fix(agents): reject empty sessions_search queries in the tool schema #129120 (comment). Historical temporal evidence is explicitly limited and is not treated as proof of temporal recall. (789f38cb2266)
  • Existing search contract: Documentation defines agent-facing session search as exact-word transcript search with existing visibility and redaction rules. The patch leaves these owners and storage contracts unchanged. Public docs: docs/concepts/session-search.md. (docs/concepts/session-search.md:11, 789f38cb2266)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (41 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-09T21:08:05.067Z sha 303b24245c036ffccab44d02404ea07094b48511 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T21:38:31.768Z sha 303b24245c036ffccab44d02404ea07094b48511 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-11T00:33:06.352Z sha adbaa36541d0c223bdda2cc6abb600ad9ab20a90 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T09:25:18.686Z sha 0e38c73 :: needs maintainer review before merge. :: none
  • reviewed September 22, 2026, 2:52 AM ET / 06:52 UTC (Revision 38) sha unknown :: blocked before merge. :: none
  • reviewed 2026-09-27T10:59:16.740Z sha 0e38c73 :: blocked before merge. :: none
  • reviewed 2026-10-02T20:24:56.635Z sha 053594c :: needs maintainer review before merge. :: none
  • reviewed 2026-10-02T20:36:25.693Z sha 053594c :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 25, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 25, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 25, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 25, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 25, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 25, 2026
@ruel225
ruel225 force-pushed the fix/sessions-search-empty-query-129054 branch 2 times, most recently from dd10f1d to 8595c2d Compare August 26, 2026 01:24
@ruel225
ruel225 force-pushed the fix/sessions-search-empty-query-129054 branch from 8595c2d to f7663f0 Compare August 26, 2026 02:26
@ruel225
ruel225 force-pushed the fix/sessions-search-empty-query-129054 branch from f7663f0 to 13daf63 Compare August 26, 2026 02:40
@ruel225

ruel225 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

P1 addressed: the finalizer (applyToolAvailabilityDescriptions in agent-tools.deferred-followup.ts) now appends a final-set-aware temporal route to sessions_search's tool.description — "For a time range (e.g. 'yesterday') list sessions with sessions_list, then read sessions_history." — gated on sessions_list surviving authorization (sessions_history already gated the preceding sentence). This is the surface the earlier review flagged as having no final-set-aware route through sessions_list for a time-range question.

The same gated temporal route is also carried in the prompt tool-summary (system-prompt.ts), routed only when both sessions_list and sessions_history are available. Availability-matrix tests cover all four tool-set combinations on both surfaces (prompt summary: 127/127; finalizer: 24/24) — the temporal route appears only in the full matrix. Prompt snapshots regenerated to lock the finalizer text (12/12). Head: 13daf634d0f.

@clawsweeper re-review

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 30, 2026
@ruel225
ruel225 force-pushed the fix/sessions-search-empty-query-129054 branch 3 times, most recently from 5f1faf0 to 5f32670 Compare August 30, 2026 05:44
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 30, 2026
@ruel225

ruel225 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Re-ran the live proof on the exact current head 32384525cdf9 (previous run was built at 5f3267034d20; the rebase moved prompt/finalizer sources, so the byte-identical claim no longer held and the run was repeated instead of argued). The PR body now opens the Real-behavior proof section with the result: the issue's temporal-recall request completes in ~21.6s through the authorized sessions_list → sessions_history route with a legal non-empty sessions_search query alongside, and keyword recall answers the seeded codename. Tool chain is quoted from the sandbox session store's transcript_events.

@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@ruel225

ruel225 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR body was replaced at the same head 32384525cdf9 (no code change, head unchanged): the Real-behavior proof section previously quoted only a trace excerpt with [...] elisions, which the review could not retrieve. The complete three-step live-run trace is now inline verbatim, sanitized. CI remains green on the current head.

@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@ruel225

ruel225 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Full tool-call trace - transcript_events, head 303b24245c0, run 2026-09-10

Re-run on the current head 303b24245c0 (2026-09-10): the branch was rebased onto current main (8ba562ec5165) again (only prompt-snapshot fixture counts changed; the non-fixture diff is byte-identical to the previously reviewed head 84c3b42a9407, verifiable with git show 84c3b42a9407 vs this head), so the run was repeated instead of argued. Same configuration as the 2026-09-07 and 2026-09-09 runs: dist built with pnpm build from this head (CLI banner 2026.9.3 (303b242), build-info.json commit 303b24245c036ffccab44d02404ea07094b48511), embedded agent (openclaw agent --local), isolated fresh OPENCLAW_STATE_DIR with no pre-existing sessions, tools.sessions.visibility: "agent", and a real hosted OpenAI-completions provider from models.providers.

Verbatim read-back from the run's own session store (transcript_events of the sandbox agent database, one block per step, in run order); provider and model identifiers are redacted (including responseModel variants); every quoted string is synthetic content authored for this run. The temporal step shows the authorized route the fix advertises: sessions_list (time window) -> sessions_history (read the seeded session) -> answer. The keyword step goes straight through sessions_search with a non-empty query ({"query":"project codename","limit":10}). No empty or whitespace-only query call occurs anywhere in the run: the schema-level pattern: "\\S" rejection means the model never emits one, and no retry loop starts.

########## agent:main:proof-keyword
[seq=4 user] Earlier today, in a different conversation, I mentioned a project codename. What codename did I give? Check my past conversations with your session tools and answer.
[seq=5 assistant toolCall] name=sessions_search arguments={"query":"project codename","limit":10}
[seq=6 toolResult] {
  "results": [
    {
      "sessionKey": "agent:main:proof-seed",
      "timestamp": 1788989183484,
      "role": "assistant",
      "snippet": "\n\nGot it — AMBER-LANTERN is today's project codename.",
      "score": 0.00000275,
      "sessionId": "e7726a98-b0f5-48eb-bca6-a7702895c806",
      "messageId": "8d74a022-87c8-4167-a55e-6bdca63cc094"
    },
    {
      "sessionKey": "agent:main:proof-seed",
      "timestamp": 1788989174542,
      "role": "user",
      "snippet": "My project codename for today is AMBER-LANTERN. Please acknowledge it briefly.",
      "score": 0.0000025882352941176473,
      "sessionId": "e7726a98-b0f5-48eb-bca6-a7702895c806",
      "messageId": "04785efd-8689-468c-94c4-1392fc600e1b"
    },
    {
      "sessionKey": "agent:main:proof-keyword",
      "timestamp": 1788989227542,
      "role": "user",
      "snippet": "Earlier today, in a different conversation, I mentioned a project codename. What codename did I give? Check my past conversations with your session tools and answer.",
      "score": 0.0000024048582995951415,
      "sessionId": "4b1d8221-bfcf-4805-b905-80beeb3a1db3",
      "messageId": "6fc114de-d23f-4d76-a86d-71fb47127d5d"
    },
    {
      "sessionKey": "agent:main:proof-temporal",
      "timestamp": 1788989212187,
      "role": "assistant",
      "snippet": " … agent:main:proof-seed**\n- You introduced your project codename for today: **AMBER-LANTERN**\n- I acknowledged it briefly\n\nThat's the only substantive conversation from earlier today. This current session is where you're now asking me to summarize what we discussed.\n\nWould you like me to check for …",
      "score": 0.0000011578947368421053,
      "sessionId": "b7317580-9784-4ec1-b1f4-a620bec459dc",
      "messageId": "a4b21bbb-c66f-4c8e-8c70-7ced33787ad9"
    }
  ]
}
[seq=8 assistant toolCall] name=sessions_history arguments={"sessionKey":"agent:main:proof-seed","messageId":"04785efd-8689-468c-94c4-1392fc600e1b","limit":5}
[seq=9 toolResult] {
  "sessionKey": "agent:main:proof-seed",
  "messages": [
    {
      "role": "user",
      "content": "My project codename for today is AMBER-LANTERN. Please acknowledge it briefly.",
      "timestamp": 1788989167536,
      "__openclaw": {
        "senderIsOwner": true,
        "id": "04785efd-8689-468c-94c4-1392fc600e1b",
        "idempotencyKey": "ef4c76e1-4917-4559-bee4-09e58a8cf2e2:user",
        "recordTimestampMs": 1788989174542,
        "transcriptPosition": {
          "source": "4GruZJkyaKe2pfwtYHtlu4byYEVraGecUaIw10qBkak",
          "rawSeq": 4
        },
        "seq": 1
      },
      "idempotencyKey": "ef4c76e1-4917-4559-bee4-09e58a8cf2e2:user"
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "text",
          "text": "\n\nGot it — AMBER-LANTERN is today's project codename."
        }
      ],
      "api": "openai-completions",
      "provider": "<redacted-provider>",
      "model": "<redacted-model>",
      "stopReason": "stop",
      "timestamp": 1788989174578,
      "responseId": "chatcmpl-ae3d625d-86b1-4603-b467-4bf76b5f59e6",
      "responseModel": "<redacted-model>",
      "openclawDelivery": {
        "textPhaseRequiresTerminal": true
      },
      "__openclaw": {
        "runId": "6d8346d0-8206-4496-a144-db3ddbc88feb",
        "id": "8d74a022-87c8-4167-a55e-6bdca63cc094",
        "recordTimestampMs": 1788989183484,
        "transcriptPosition": {
          "source": "4GruZJkyaKe2pfwtYHtlu4byYEVraGecUaIw10qBkak",
          "rawSeq": 5
        },
        "seq": 2
      }
    }
  ],
  "truncated": true,
  "droppedMessages": false,
  "contentTruncated": true,
  "contentRedacted": false,
  "bytes": 1144,
  "pendingInputs": {
    "items": [],
    "total": 0
  }
}
[seq=11 assistant] 

The project codename you gave earlier today was **AMBER-LANTERN**.

You mentioned it in session `agent:main:proof-seed`, and I acknowledged it at the time.

########## agent:main:proof-temporal
[seq=4 user] What did we talk about earlier today? Summarize my past conversations from today.
[seq=5 assistant toolCall] name=sessions_list arguments={"activeMinutes":1440,"includeLastMessage":true,"limit":50}
[seq=6 toolResult] {
  "count": 2,
  "sessions": [
    {
      "key": "agent:main:proof-temporal",
      "sessionId": "b7317580-9784-4ec1-b1f4-a620bec459dc",
      "agentId": "main",
      "kind": "other",
      "channel": "unknown",
      "archived": false,
      "pinned": false,
      "updatedAt": 1788989203034,
      "model": "<redacted-model>",
      "contextTokens": 262144,
      "status": "running",
      "lastMessagePreview": "What did we talk about earlier today? Summarize my past conversations from today."
    },
    {
      "key": "agent:main:proof-seed",
      "sessionId": "e7726a98-b0f5-48eb-bca6-a7702895c806",
      "agentId": "main",
      "kind": "other",
      "channel": "unknown",
      "archived": false,
      "pinned": false,
      "updatedAt": 1788989183563,
      "model": "<redacted-model>",
      "contextTokens": 262144,
      "totalTokens": 35006,
      "abortedLastRun": false,
      "lastMessagePreview": "Got it — AMBER-LANTERN is today's project codename."
    }
  ],
  "visibility": {
    "mode": "agent",
    "restricted": true,
    "warning": "Session visibility is restricted (effective tools.sessions.visibility=agent: all sessions of this agent). Sessions outside that scope are omitted from results and count."
  }
}
[seq=8 assistant toolCall] name=sessions_history arguments={"limit":100,"sessionKey":"agent:main:proof-seed"}
[seq=9 toolResult] {
  "sessionKey": "agent:main:proof-seed",
  "messages": [
    {
      "role": "user",
      "content": "My project codename for today is AMBER-LANTERN. Please acknowledge it briefly.",
      "timestamp": 1788989167536,
      "__openclaw": {
        "senderIsOwner": true,
        "id": "04785efd-8689-468c-94c4-1392fc600e1b",
        "idempotencyKey": "ef4c76e1-4917-4559-bee4-09e58a8cf2e2:user",
        "recordTimestampMs": 1788989174542,
        "transcriptPosition": {
          "source": "4GruZJkyaKe2pfwtYHtlu4byYEVraGecUaIw10qBkak",
          "rawSeq": 4
        },
        "seq": 1
      },
      "idempotencyKey": "ef4c76e1-4917-4559-bee4-09e58a8cf2e2:user"
    },
    {
      "role": "assistant",
      "content": [
        {
          "type": "text",
          "text": "\n\nGot it — AMBER-LANTERN is today's project codename."
        }
      ],
      "api": "openai-completions",
      "provider": "<redacted-provider>",
      "model": "<redacted-model>",
      "stopReason": "stop",
      "timestamp": 1788989174578,
      "responseId": "chatcmpl-ae3d625d-86b1-4603-b467-4bf76b5f59e6",
      "responseModel": "<redacted-model>",
      "openclawDelivery": {
        "textPhaseRequiresTerminal": true
      },
      "__openclaw": {
        "runId": "6d8346d0-8206-4496-a144-db3ddbc88feb",
        "id": "8d74a022-87c8-4167-a55e-6bdca63cc094",
        "recordTimestampMs": 1788989183484,
        "transcriptPosition": {
          "source": "4GruZJkyaKe2pfwtYHtlu4byYEVraGecUaIw10qBkak",
          "rawSeq": 5
        },
        "seq": 2
      }
    }
  ],
  "truncated": true,
  "droppedMessages": false,
  "contentTruncated": true,
  "contentRedacted": false,
  "bytes": 1144,
  "pendingInputs": {
    "items": [],
    "total": 0
  }
}
[seq=11 assistant] 

Looking at your sessions from today (2026-09-10), here's what we talked about:

## Earlier Today

**Session: agent:main:proof-seed**
- You introduced your project codename for today: **AMBER-LANTERN**
- I acknowledged it briefly

That's the only substantive conversation from earlier today. This current session is where you're now asking me to summarize what we discussed.

Would you like me to check for any other sessions or dig deeper into anything specific?

########## agent:main:proof-seed
[seq=4 user] My project codename for today is AMBER-LANTERN. Please acknowledge it briefly.
[seq=5 assistant] 

Got it — AMBER-LANTERN is today's project codename.

@ruel225

ruel225 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@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 32384525cdf9 (no code change, nothing re-run or elided):

  • The complete verbatim trace now lives in the dedicated comment above (Full tool-call trace — transcript_events, head 32384525cdf9, comment id 5593939142) — step1/step2/step3 complete, one block per step, in run order.
  • The PR description shrank to ~14 KB, keeping the result-first summary, configuration note, step timings, and negative control in place; the trace position in the description now points to that comment.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@ruel225

ruel225 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The branch was rebased onto current main (8ba562ec5165); only prompt-snapshot fixture counts changed and the non-fixture diff is byte-identical to the previously reviewed head 84c3b42a9407 (verifiable with git show 84c3b42a9407 vs this head). Per the established protocol the live proof was re-run at the new head 303b24245c0 rather than argued from diff equality: dist built from this head (CLI banner 2026.9.3 (303b242), build-info.json commit 303b24245c036ffccab44d02404ea07094b48511), embedded agent (openclaw agent --local), fresh isolated OPENCLAW_STATE_DIR with no pre-existing sessions, tools.sessions.visibility: "agent", and the same three-step setup as the 2026-09-07 and 2026-09-09 runs.

The temporal step again routes sessions_list (time window) → sessions_history (read the seeded session) → answer, the keyword step again goes straight through sessions_search with a non-empty query ({"query":"project codename","limit":10}), and no empty or whitespace-only query call occurs anywhere in the run. The dedicated trace comment and the PR body now carry this 2026-09-10 run (provider and model identifiers redacted, including responseModel variants; all quoted strings are synthetic content authored for the run).

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@ruel225

ruel225 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

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.

@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Updated head: 053594c3ff1e7a5f49d123e78eaf4e6a8333c5a5. Contributor commits are preserved; conflicts with main are resolved and the temporal summary follows main's extracted tool-list owner. Repository-generated prompt snapshots are current. The PR body lists exact deterministic prompt/schema byte changes, failing-before/passing-after regression evidence, keyword control, and the four-request real Gateway gpt-5-mini comparison, including the limitation that the candidate used a non-empty query but did not retrieve the seeded temporal topics. No changelog change is intended.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Please review exact head 789f38cb2266f83a5b8fdad9f40b8b7e6fae4078. One preserving commit narrows the repair to query minLength/concise tool-local description, the actionable existing execution guard, and focused regressions. Temporal system-prompt/finalizer guidance was removed because the real-model run did not establish its benefit. Generated tool catalog differs from main only in the query schema (+100 compact UTF-8 bytes); system-prompt guidance and tool descriptions are unchanged. The PR body explicitly distinguishes baseline schema acceptance from baseline execution rejection. Narrowed tests fail 3/21 on baseline and pass 21/21 on candidate; 17 snapshot cases pass; exact-head real Gateway smoke proves retry errors and unchanged keyword results. Existing real-model evidence is reused with its limitations; no additional provider calls.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Landed as 54db277. Thanks @ruel225! We kept the schema constraint and retry guidance and deferred the time-range prompt guidance, since live runs didn't show the model using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sessions_search: query schema has no minLength or description — models emit query: ""

2 participants