Skip to content

fix(web-search): later results come back empty when early snippets are long - #179703

Merged
obviyus merged 3 commits into
openclaw:mainfrom
Canvinus:fix/web-search-fair-result-budget
Oct 26, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
Canvinus:fix/web-search-fair-result-budget

Conversation

@Canvinus

@Canvinus Canvinus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Long early web-search snippets consume the shared text budget in provider order, leaving later results with URLs but empty titles and snippets. Preserve useful later results while retaining provider ranking, source URLs, security wrapping and the existing aggregate cap. Thanks @Canvinus for the original fix and reproduction.

Why This Change Was Made

Allocate prose from shorter rows to longer rows, then place results back in their original order. The allocation demand must use the same unwrapping and existing sanitization measurement that wrapProse charges: short special tokens can expand substantially after sanitization. Measuring raw length can unnecessarily truncate rows whose complete sanitized text fits the budget.

The repair reuses the existing sanitizer without changing its policy, introduces no options or state, and leaves the 20,000-character URL/prose budget intact. The result-shape documentation now explains that budget and preserved ordering.

Evidence

Inspect the captured built-Gateway tool results and red/green regression output.

Fresh Linux Node 24.22.1 artifacts:

  • Main: bdf12f6b6b1235f10ee361687e0c32db94dd3a6b.
  • Gateway-proof candidate: 7b2e3d1be78748172fd55960958c60f5f01213ea.

Current head 048a7c794a4f2900d85b7197c826db595050c985 resolves the merge conflict by keeping main's consolidated web-search.test.ts and moving both budget regressions into it. The obsolete security test file stays deleted. The PR's only changed production file is byte-identical to the Gateway-proof candidate, so that evidence carries forward. Current-head focused checks and relocated red/green regression capture.

A local Brave-compatible HTTP fixture returns ten results with snippet lengths 12,000, 9,000 and eight times 100. A deterministic local Responses fixture drives a normal Gateway-backed agent turn through the actual Brave plugin and web_search tool. The driver records the actual model-facing function_call_output; it does not import or replay the normalizer. Both lanes use the same documented direct-tool settings and synthetic keys; search URL guards remain enabled. This is a built-Gateway proof, not a hosted-model claim.

Each lane ran twice:

Observation Main, both runs Candidate, both runs
Snippet lengths by original rank 12,000; 7,763; then eight zeroes 9,800; 9,000; then eight full 100-character snippets
Titles Only first two retain text All ten retain text in original order
Source URLs All ten retained All ten retained in original order
Charged URL/prose characters 20,000 20,000
Truncation reported Yes Yes; only longest snippet trimmed

The sanitization-expansion pair also ran twice per lane through Brave: both full snippets survive at 11,500 and 6,000 characters, without truncation. Its charge is 17,566 including Brave's site names. The separate raw-provider reviewer counterexample totals 17,544: the new regression fails on the original contributor allocation (truncated: true) and passes after this measurement repair, with both complete snippets and no truncation metadata.

Focused Validation

  • Full pnpm build succeeds for both fresh artifacts.
  • 64 current-head focused tests pass across consolidated web-search coverage, external-content sanitization and tool-prefix stability, using one worker.
  • Scoped Oxfmt/Oxlint pass; documentation formatting passes.
  • The consolidated web-search file runs 40 tests in 28.71 seconds of cold wall time, dominated by shared worker compilation; both added cases report under 1 ms. Captured timing details are linked above; hosted CI timing comes from the exact-head run.
  • The original serialized-size allowance increases only for the extra security envelopes on retained fields. The independent 20,000-character content assertion remains unchanged.

Simplification: one normalizer owns allocation and existing security helpers still own sanitization/wrapping. No alternate result path, cache, schema, public export or test-only production seam. Whole-PR deltas: production +41/-13, tests +54/-1, docs +7/-0.

Merge danger: two-way door, fully revertible. No persisted state or configuration changes. Blast radius is the distribution of prose within normalized structured web-search results; an incorrect allocation could clip useful text or waste the existing budget. Provider ordering, URL reservation, aggregate bounds and untrusted-content envelopes remain protected.

…e long

web_search keeps one 20,000-character budget for a search's untrusted text. Source URLs were already reserved first, but titles, snippets and site names were then charged in result order, so a few long snippets (Exa's default highlights run to several thousand characters per page) used the whole budget and the remaining results came back with an empty title and snippet.

Rows are now charged from the least text to the most, each within an equal share of what is left, so results that fit keep everything and only the longest are trimmed. Within a row the title and site name come before the snippet. The aggregate bound is unchanged.
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Distribute the existing web-search text budget across results so long early snippets do not leave later results empty.

Example: Brave returns ten snippets containing 12,000, 9,000, and eight times 100 characters.

  • Before: The last eight results retain URLs but have empty titles and snippets.
  • After: All ten retain their titles and original order; only the longest snippet is trimmed, to 9,800 characters.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with shipped-entry-point before/after evidence, distinct regressions, preserved security contracts, and no remaining findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Built-Gateway captures exercise the actual Brave HTTP adapter and web_search normalizer through an agent turn driven by a local Responses fixture; both repeated candidate runs preserve later results and source order within the existing cap, and the exercised production file is byte-identical to the reviewed head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Later search results lose their titles and snippets when earlier snippets exhaust the shared budget.
Reason: The repair restores useful search results within the existing bounds and security contract, with collaborator-backed production-path evidence and no new settings.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current web-search defect with a focused, proven repair; the previous conflict is resolved, no actionable findings remain, and exact-head CI is still running.

Priority: P2
Reviewed head: 048a7c794a4f2900d85b7197c826db595050c985

Before merge

None.

Findings

None.

Agent review details

How this fits together

The core web_search tool normalizes provider responses into bounded, security-wrapped results before returning them to the agent.

flowchart LR
  A[Agent tool call] --> B[Web search runtime]
  B --> C[Provider HTTP adapter]
  C --> D[Output normalizer]
  D --> E[Shared sanitizer and wrapper]
  E --> F[Model-facing tool result]
Loading

Technical review

Best possible solution:

Land the shared-normalizer allocation repair after the existing exact-head checks pass.

Do we have a high-confidence way to reproduce the issue?

Current-main source establishes sequential budget exhaustion, and the supplied built-Gateway captures demonstrate it before the repair; no target code was executed during this review.

Is this the best way to solve the issue?

The smallest complete fix belongs in the existing output normalizer: measure sanitized row demand, allocate bounded shares, and restore provider order while retaining URL reservation and wrapping.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 642b31d1993b.

Provenance checked

  • Structured result normalization and prose allocation changes intended behavior with a stated reason (c83dcc2: The security hardening bounded sanitized provider prose and reserved source URLs at the canonical output boundary.)
  • Boundary-owned security wrapping keeps the original intent (19296b0: Normalize divergent provider payloads and prevent provider metadata from spoofing untrusted-content envelopes.)
  • Consolidated regression coverage keeps the original intent (d77f79c: Remove duplicate test coverage while preserving existing security contracts; the repair keeps the consolidated suite and adjusts only envelope overhead while retaining the independent content bound.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +28, Tests +53, Docs +7. Total +88 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 41 13 +28
Tests 1 54 1 +53
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 102 14 +88

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +41/-13; tests +54/-1 Growth implements allocation in the existing owner and covers starvation plus sanitization expansion without new production seams.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Long provider snippets can silently strip useful text from later search results, with a limited blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-21T18:02:51.003Z sha 9ddbcfd :: needs real behavior proof before merge. :: [P2] Measure sanitized text before ordering row allocation
  • reviewed 2026-10-26T05:25:50.577Z sha 7b2e3d1 :: needs changes before merge. :: none

Reviewed October 26, 2026, 2:40 AM ET / 06:40 UTC (Revision 3).

@obviyus

obviyus commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Captured built-Gateway tool results — #179703

Main and candidate each ran the long-excerpt scenario twice, through the shipped Gateway, real Brave plugin HTTP adapter and actual web_search normalizer. A deterministic local Responses fixture drives the agent turn; this is not a hosted-model claim. The local search backend serves snippets of 12,000, 9,000 and eight times 100 characters. Both lanes use documented direct tool exposure, with no helper replay or normalizer import in the driver.

The JSON below is extracted from the actual function_call_output received by the model transport. Titles and lengths omit existing external-content envelopes solely for measurement; rawLastResult is copied verbatim. Source URL order is asserted against all ten input ranks. All charges stay within the existing 20,000-character content budget. No credentials, account identifiers, emails, IPs or private endpoints are included.

{
  "mainSha": "bdf12f6b6b1235f10ee361687e0c32db94dd3a6b",
  "candidateSha": "7b2e3d1be78748172fd55960958c60f5f01213ea",
  "longExcerptRuns": [
    {
      "lane": "main",
      "query": "p179703-long-1",
      "kind": "results",
      "provider": "brave",
      "count": 10,
      "truncated": true,
      "chargedChars": 20000,
      "titles": [
        "result 0",
        "result 1",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
      ],
      "snippetChars": [
        12000,
        7763,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "rawLastResult": {
        "title": "",
        "url": "https://example.com/9",
        "snippet": "",
        "siteName": ""
      }
    },
    {
      "lane": "main",
      "query": "p179703-long-2",
      "kind": "results",
      "provider": "brave",
      "count": 10,
      "truncated": true,
      "chargedChars": 20000,
      "titles": [
        "result 0",
        "result 1",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
      ],
      "snippetChars": [
        12000,
        7763,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "rawLastResult": {
        "title": "",
        "url": "https://example.com/9",
        "snippet": "",
        "siteName": ""
      }
    },
    {
      "lane": "candidate",
      "query": "p179703-long-1",
      "kind": "results",
      "provider": "brave",
      "count": 10,
      "truncated": true,
      "chargedChars": 20000,
      "titles": [
        "result 0",
        "result 1",
        "result 2",
        "result 3",
        "result 4",
        "result 5",
        "result 6",
        "result 7",
        "result 8",
        "result 9"
      ],
      "snippetChars": [
        9800,
        9000,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100
      ],
      "rawLastResult": {
        "title": "\n<<<EXTERNAL_UNTRUSTED_CONTENT id=\"d6d5420e4f83abd9\">>>\nSource: Web Search\n---\nresult 9\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id=\"d6d5420e4f83abd9\">>>",
        "url": "https://example.com/9",
        "snippet": "\n<<<EXTERNAL_UNTRUSTED_CONTENT id=\"79add66c1434326f\">>>\nSource: Web Search\n---\nssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id=\"79add66c1434326f\">>>",
        "siteName": "\n<<<EXTERNAL_UNTRUSTED_CONTENT id=\"6d7cbba82e70f87d\">>>\nSource: Web Search\n---\nexample.com\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id=\"6d7cbba82e70f87d\">>>"
      }
    },
    {
      "lane": "candidate",
      "query": "p179703-long-2",
      "kind": "results",
      "provider": "brave",
      "count": 10,
      "truncated": true,
      "chargedChars": 20000,
      "titles": [
        "result 0",
        "result 1",
        "result 2",
        "result 3",
        "result 4",
        "result 5",
        "result 6",
        "result 7",
        "result 8",
        "result 9"
      ],
      "snippetChars": [
        9800,
        9000,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100
      ],
      "rawLastResult": {
        "title": "\n<<<EXTERNAL_UNTRUSTED_CONTENT id=\"fbfbc31b1cf38cd3\">>>\nSource: Web Search\n---\nresult 9\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id=\"fbfbc31b1cf38cd3\">>>",
        "url": "https://example.com/9",
        "snippet": "\n<<<EXTERNAL_UNTRUSTED_CONTENT id=\"b8aff62ba54dc131\">>>\nSource: Web Search\n---\nssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id=\"b8aff62ba54dc131\">>>",
        "siteName": "\n<<<EXTERNAL_UNTRUSTED_CONTENT id=\"f519047290fdb0b8\">>>\nSource: Web Search\n---\nexample.com\n<<<END_EXTERNAL_UNTRUSTED_CONTENT id=\"f519047290fdb0b8\">>>"
      }
    }
  ],
  "expansionRuns": [
    {
      "lane": "main",
      "query": "p179703-expansion-1",
      "truncated": false,
      "chargedChars": 17566,
      "rows": [
        {
          "title": "a",
          "url": "https://example.com/a",
          "snippetChars": 11500,
          "siteName": "example.com"
        },
        {
          "title": "b",
          "url": "https://example.com/b",
          "snippetChars": 6000,
          "siteName": "example.com"
        }
      ]
    },
    {
      "lane": "main",
      "query": "p179703-expansion-2",
      "truncated": false,
      "chargedChars": 17566,
      "rows": [
        {
          "title": "a",
          "url": "https://example.com/a",
          "snippetChars": 11500,
          "siteName": "example.com"
        },
        {
          "title": "b",
          "url": "https://example.com/b",
          "snippetChars": 6000,
          "siteName": "example.com"
        }
      ]
    },
    {
      "lane": "candidate",
      "query": "p179703-expansion-1",
      "truncated": false,
      "chargedChars": 17566,
      "rows": [
        {
          "title": "a",
          "url": "https://example.com/a",
          "snippetChars": 11500,
          "siteName": "example.com"
        },
        {
          "title": "b",
          "url": "https://example.com/b",
          "snippetChars": 6000,
          "siteName": "example.com"
        }
      ]
    },
    {
      "lane": "candidate",
      "query": "p179703-expansion-2",
      "truncated": false,
      "chargedChars": 17566,
      "rows": [
        {
          "title": "a",
          "url": "https://example.com/a",
          "snippetChars": 11500,
          "siteName": "example.com"
        },
        {
          "title": "b",
          "url": "https://example.com/b",
          "snippetChars": 6000,
          "siteName": "example.com"
        }
      ]
    }
  ]
}

The Brave expansion pair retains 11,500 and 6,000 snippet characters, untruncated, in both lanes; its 17,566 charge includes Brave’s site names. The separate reviewer counterexample uses raw provider rows without those site names (17,544 total), and failed on the original contributor allocation before the measurement repair:

 FAIL   unit-fast  src/agents/tools/web-search-output.security.test.ts > web_search normalized output security > keeps rows whole when sanitized prose demand changes their allocation order
AssertionError: expected true to be undefined

- Expected:
undefined

+ Received:
true

 ❯ src/agents/tools/web-search-output.security.test.ts:132:34
    130|
    131|     assertOutputKind(normalized, "results");
    132|     expect(normalized.truncated).toBeUndefined();
       |                                  ^
    133|     expect(
    134|       normalized.results.map((row) => ({

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯


 Test Files  1 failed (1)
      Tests  1 failed | 13 skipped (14)
   Start at  05:05:34
   Duration  540ms (transform 71%, import 24%, setup 3%, tests 1%, worker 1%)

[test] failed 1 Vitest shard in 5.55s
[test] FAILED (exit 1)

After the repair, captured focused-check output:

 ✓  unit-fast  src/agents/tools/web-search-output.security.test.ts > web_search normalized output security > keeps rows whole when sanitized prose demand changes their allocation order 0ms
      Tests  14 passed (14)
   Duration  275ms (import 46%, transform 41%, setup 6%, tests 6%, worker 1%)
      Tests  19 passed (19)
   Duration  2.44s (transform 53%, worker 25%, tests 12%, setup 9%)
      Tests  5 passed (5)
   Duration  40.41s (transform 85%, import 5%, tests 5%, worker 4%)
[test] passed 3 Vitest shards in 46.24s

The additional web-search.test.ts consumer suite passes all 45 tests, for 83 focused tests total including sanitizer and prefix-stability coverage. Oxfmt/Oxlint and both fresh artifact builds pass. Full raw tool results and the fixture harness are retained for maintainer reproduction.

@obviyus

obviyus commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Oct 26, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 26, 2026
@obviyus

obviyus commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Current-head conflict resolution and regression capture

Head: 048a7c794a4f2900d85b7197c826db595050c985. Merged current main and kept its test consolidation: the obsolete web-search-output.security.test.ts stays deleted, while both distinct budget regressions now live in web-search.test.ts.

The PR's only changed production file, web-search-output.ts, is byte-identical to the exercised 7b2e3d1be78748172fd55960958c60f5f01213ea revision, so the twice-per-lane built-Gateway captures carry forward. Conflict resolution changed test placement, not the allocation repair.

Scoped Oxfmt/Oxlint and 64 current-head focused tests pass:

 ✓  unit-fast  src/agents/tools/web-search.test.ts > web_search normalized output security > keeps later results whole when early pages are long and trims only the longest 0ms
 ✓  unit-fast  src/agents/tools/web-search.test.ts > web_search normalized output security > keeps rows whole when sanitized prose demand changes their allocation order 0ms
      Tests  40 passed (40)
   Duration  28.71s (transform 97%, import 3%)
      Tests  11 passed (11)
   Duration  961ms (worker 47%, transform 37%, tests 8%, setup 8%)
      Tests  13 passed (13)
   Duration  18.73s (transform 70%, tests 16%, import 10%, worker 3%)
[test] passed 3 Vitest shards in 81.67s

The relocated expansion regression still fails when only the original contributor production file is restored, and the repaired file was restored after this negative control:

 FAIL   unit-fast  src/agents/tools/web-search.test.ts > web_search normalized output security > keeps rows whole when sanitized prose demand changes their allocation order
AssertionError: expected true to be undefined

- Expected:
undefined

+ Received:
true

 ❯ src/agents/tools/web-search.test.ts:377:34
    375|
    376|     assertOutputKind(normalized, "results");
    377|     expect(normalized.truncated).toBeUndefined();
       |                                  ^
    378|     expect(
    379|       normalized.results.map((row) => ({

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯


 Test Files  1 failed (1)
      Tests  1 failed | 39 skipped (40)
   Start at  06:31:07
   Duration  24.51s (transform 97%, import 3%)

[vitest-workers] verifying completed generation before cleanup
[vitest-workers] retained completed compiler outputs for reuse
[test] failed 1 Vitest shard in 26.60s
[test] FAILED (exit 1)

@obviyus

obviyus commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@obviyus
obviyus merged commit 47c1c2a into openclaw:main Oct 26, 2026
128 checks passed
@obviyus

obviyus commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Landed in 47c1c2a. Thanks @Canvinus. Long early snippets no longer blank later web search results.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…e long (openclaw#179703)

fix(web-search): share the result text budget so long early snippets don't blank later results

Web search results shared one text budget allocated in provider row order, so long snippets in early results used it up and later results came back with blank titles and snippets. Rows are now allocated shortest-first by their real sanitized length, so every result keeps its title and only the longest snippets are trimmed.

Evidence: built Gateway agent turns with a local search-provider fixture returning long early snippets, inspecting the actual tool result. On main the last eight of ten results had blank titles and snippets (twice); with this change all ten titles were kept in their original URL and ranking order, and only the longest snippet was trimmed (twice). Both stay within the same 20,000-character budget. A regression for sanitization expansion fails before the repair and passes after. Details: openclaw#179703 (comment).

Thanks @Canvinus.

Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 28, 2026
…e long (#179703)

fix(web-search): share the result text budget so long early snippets don't blank later results

Web search results shared one text budget allocated in provider row order, so long snippets in early results used it up and later results came back with blank titles and snippets. Rows are now allocated shortest-first by their real sanitized length, so every result keeps its title and only the longest snippets are trimmed.

Evidence: built Gateway agent turns with a local search-provider fixture returning long early snippets, inspecting the actual tool result. On main the last eight of ten results had blank titles and snippets (twice); with this change all ten titles were kept in their original URL and ranking order, and only the longest snippet was trimmed (twice). Both stay within the same 20,000-character budget. A regression for sanitization expansion fails before the repair and passes after. Details: #179703 (comment).

Thanks @Canvinus.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 47c1c2a)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit b2d6915dbf99322b12a80a5fc59634016e35bef2)
RomneyDa added a commit that referenced this pull request Oct 29, 2026
…s lane FRV tests (#187567)

* docs(secrets): include Beam mirror token in credential matrix

(cherry picked from commit dfa7774)

* test(infra): supply versions list in astral ClawHub detail fixture

The backport of #182753 (74e414a) dropped the versions: { items: [] }
default that main's readDetail helper supplies, so the release-branch
fixture fails the versions response guard.

* test(web-search): carry #179703 envelope bound into release security test

Main's 47c1c2a raised the aggregate JSON envelope bound from 22,000 to
23,000 because rows now keep their titles and site names (more wrap
envelopes); the 20,000-char untrusted content cap is unchanged. The release
backport 2b35452 put the new tests in web-search-budget.test.ts and
missed this assertion in the release-only security test file.

* test(auto-reply): expect preserved multiline /side input in registry test

Backport 9b93c22 (#176293, main d7359a7) intentionally preserves
multiline /btw, /side and /loop arguments. The release-only registry test
still asserted the old first-line truncation for /side; main no longer has
that assertion.

* test(pdf): hold a Codex OAuth login in the ChatGPT PDF fixture

Backport f41ea65 (#181356, main f64e38f) intentionally resolves a
ChatGPT catalog row with only an API key as stale, routing it to the Platform
contract. Port main's matching fixture update from 280c7c7 (shipped
inside an unrelated visitor-access commit) so the test exercises the Codex
subscription route it names.

* test(auto-reply): expect agent inventory workspace for reply runtime

Release backports 23e702a (#185573) and 59b6c10 (main 786cfd7)
together adopt #185512's design: replies prepare the configured agent
inventory workspace (preserveWorkspaceDirOnRefresh: false) and nested runs
borrow it, while the reply workspace stays the execution boundary. Main's
copy of this test no longer asserts the acquire input (db8180b).

* test(agents): expect unverifiable stateless reasoning to be omitted

Backport c93fe0b (#185774, main 86ddabd) intentionally stops
replaying reasoning that has neither a replay ID nor authorized encrypted
state when store is disabled. Main removed this test earlier (542e074);
the release copy still expected the unverifiable item.

* fix(plugins): allow retained registrations on reused inspections

Catalog scope growth can reuse the same physical registry inspection. Keep
its already-owned registrations in place instead of transferring them into
their own resource map and failing with a duplicate-custody error.

Preserve live-owner validation and all distinct-inspection transfer and
disposal behavior. Extend the resource-backed lifecycle regression with
self-adoption before abandoned growth and promotion.

Proof: regression fails on unchanged production; fixed resource lifecycle
and all seven selected catalog cases pass. Targeted native types, typed
lint, format, suppression tests, runtime/static cycles and planner pass.
Independent review found no actionable P0-P2 findings.

(cherry picked from commit 52df852)

* test(agents): seed the worker catalog in the isolated-completion owner test

Backport 0c77c1d (#182952, main 4c3bf18, which shipped no test)
carried a test adapted from another line that seeded discovered rows only
through the in-process catalog builder. On this branch Gateway-configured
agents load their full catalog through the catalog worker, so the setup never
saw the row and the test failed from the commit that added it. Seed the worker
mock too and match the row by its own fields (the catalog adds provenance).
Verified: the test fails at the lease assertion when #182952's
runtimePluginPurpose normalization is removed and passes with it.

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

2 participants