Skip to content

refactor(session-catalog): normalize search at gateway#108240

Merged
steipete merged 1 commit into
mainfrom
codex/canonicalize-session-catalog-search
Jul 15, 2026
Merged

refactor(session-catalog): normalize search at gateway#108240
steipete merged 1 commit into
mainfrom
codex/canonicalize-session-catalog-search

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The session catalog gateway accepted one search value, but ACPX and OpenCode each repeated the same trim, empty-value, 500-code-unit, and surrogate-boundary policy in local and node paths. That duplicated a gateway-wide input invariant and left every other provider free to observe different values.

Why This Change Was Made

This is the retrospective cleanup from the recent session-search fixes. Normalize once at the generic gateway owner boundary, document the provider contract, and delete the ACPX/OpenCode copies. The centralized tests exercise two providers, blank input, a surrogate pair crossing the cap, and a complete pair ending at the cap.

Net result: 54 insertions, 108 deletions; one canonical policy instead of four runtime branches and duplicate provider test matrices.

User Impact

Session catalog search keeps the same trimmed, non-empty, UTF-16-safe 500-code-unit behavior. The behavior is now consistent for every registered provider, including Codex and Anthropic catalogs.

Evidence

  • Blacksmith Testbox tbx_01kxjm8kwpya8ksxy9hs21ndp2
  • Focused tests: gateway 14, ACPX 17, OpenCode 9; all passed
  • Fresh autoreview: clean, confidence 0.97
  • Direct Codex source check: ThreadListParams.search_term is optional substring input; the server owns its own search semantics
  • Full pnpm check:changed running against the exact patch; exact-head hosted CI remains the merge gate

Co-authorship preserves the contributor whose prior fix exposed the duplicated invariant.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready at exact head 02bada5a04c5871942f198ab9d498315d618bfd4.

Retrospective result:

  • One gateway-owned search normalizer now trims, drops blanks, caps at 500 UTF-16 units, and avoids split surrogate pairs before any provider fan-out.
  • Deleted ACPX and OpenCode copies from local and node paths, plus duplicate provider policy tests.
  • Net +54/-108; the invariant now covers every registered provider.

Validation:

  • Blacksmith Testbox tbx_01kxjm8kwpya8ksxy9hs21ndp2: gateway 14, ACPX 17, OpenCode 9 tests passed; full pnpm check:changed passed in 20m58s.
  • Exact-head CI run 29407560565: green.
  • Fresh autoreview: no accepted/actionable findings, confidence 0.97.
  • scripts/pr review-validate-artifacts 108240: passed.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 108240: passed.

Direct Codex dependency check at 69acc71cb18fc9a1b7858f92489cc8d135e450f2:

  • codex-rs/app-server-protocol/src/protocol/v2/thread.rs:1070-1106 defines optional substring searchTerm for thread lists.
  • codex-rs/app-server/src/request_processors/thread_processor.rs:2059-2075 confirms server-owned trim/non-empty search semantics.

No known proof gaps. Co-authorship preserves Leon-SK668's contribution from the earlier fix that exposed this duplication.

@steipete
steipete merged commit 026b688 into main Jul 15, 2026
150 of 155 checks passed
@steipete
steipete deleted the codex/canonicalize-session-catalog-search branch July 15, 2026 10:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant