Skip to content

fix(agents): prevent invalid session filters from listing every session - #129198

Merged
steipete merged 2 commits into
mainfrom
codex/qa-session-list-kind-schema
Aug 25, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa-session-list-kind-schema

Conversation

@steipete

@steipete steipete commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where agents requesting sessions with an invalid or whitespace-only session kind silently received every visible session instead of no matching sessions. The tool schema also advertised unrestricted kind strings despite the documented six supported values.

Why This Change Was Made

One canonical session-kind tuple now owns the local type and provider-safe input/output schemas. Filtering preserves whether a nonempty kind argument was explicitly supplied even when normalization discards blank values, and removes the duplicated allowlist that previously widened invalid filters.

User Impact

Session discovery now rejects unsupported kinds at the tool boundary and never broadens explicit invalid kind filters. Existing valid array and scalar calls, uppercase normalization, empty or omitted filters, visibility restrictions, and compact output contracts remain unchanged.

Evidence

  • Before: three owner-boundary regressions fail: unsupported schema values are accepted and both unknown-only and whitespace-only filters return all visible sessions.
  • After: 165 tests pass across the session-list owner, full session-tool integration, visibility, and session-tool sibling suites, including unknown/blank array and scalar values, mixed valid values, uppercase inputs, empty filters, and denied cross-agent rows.
  • Canonical prompt snapshots are regenerated and verified: one six-value tool-input enum plus deterministic metadata changes of only 202 characters / approximately 51 tokens per scenario.
  • Codex compatibility was verified directly against codex-rs/protocol/src/dynamic_tools.rs, codex-rs/app-server/src/request_processors/thread_processor.rs, and the flat-enum parser/regression in codex-rs/tools/src/json_schema.rs and json_schema_tests.rs.
  • Formatting and both assertion-safety/max-lines ratchets pass; independent review and authenticated full-diff Codex autoreview report no actionable findings.
  • Production delta: +14/-21 (net -7 lines); regression tests: +40 lines. No Gateway wire-contract, authorization, persistence, public configuration, or SDK changes.
  • Reviewed final head: fde0aec.

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 09:27
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 25, 2026
@steipete
steipete merged commit 79722d2 into main Aug 25, 2026
233 checks passed
@steipete
steipete deleted the codex/qa-session-list-kind-schema branch August 25, 2026 09:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
…on (openclaw#129198)

* fix(agents): preserve explicit session kind filtering

* test(agents): refresh session kind prompt snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant