Repository navigation
fix(agents): preserve session classification - #122697
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 12:11 PM ET / 16:11 UTC. ClawSweeper reviewWhat this changesThe PR carries Gateway session classifications into the built-in sessions-list tool, adds node classification at the Gateway producer, and adds focused regression coverage. Merge readinessKeep this PR open for maintainer landing: current main still re-parses raw keys and can misclassify agent-scoped sessions, while the proposed producer-to-consumer classification flow is correct and has no blocking finding. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway converts stored sessions into rows consumed by built-in agent tools. The sessions-list tool maps those rows to model-visible kinds before applying optional filters. flowchart LR
A[Stored sessions] --> B[Gateway session listing]
B --> C[Authoritative classification]
C --> D[Sessions-list tool]
D --> E[Kind filter]
E --> F[Model-visible sessions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +112. Total +110 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the single producer-owned classification flow after the normal maintainer merge gates; it removes the duplicate raw-key policy rather than extending it. Do we have a high-confidence way to reproduce the issue? Yes—current source establishes the misclassification path, and the PR’s boundary test constructs real Gateway rows before exercising every affected filter; it was not executed in this read-only review. Is this the best way to solve the issue? Yes—the Gateway is already the authoritative classifier, and projecting its recorded fact removes the duplicate parser that loses agent-scoped classifications. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6093e3477d80. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
sessions_listdiscarded the Gateway’s authoritative sessionclassificationand re-derived coarse kinds from raw key prefixes. Real session keys are agent-scoped, so main, cron, hook, and node rows such asagent:main:cron:nightlywere classified asother; kind-filtered calls could return empty results for sessions that existed.Why This Change Was Made
The agent tool now carries and projects the prepared Gateway classification instead of parsing keys again:
main;group;other;Raw-key inference is removed. The built-in sessions tool and Gateway are same-version, in-process owners, so no legacy fallback is retained. The existing protocol field is reused; no schema or protocol change is introduced. The separate post-filter pagination issue is intentionally out of scope.
AI-assisted: yes. The owner-boundary repair and actual Gateway-row regression were manually inspected and passed fresh structured autoreview after final rebase.
User Impact
Models can reliably list and filter real agent-scoped main, cron, hook, group, and node sessions instead of silently losing them as
other.Evidence
other; all four corresponding kind filters returned empty results. Node’s producer classification was alsocustom.buildGatewaySessionRowoutput instead of unrealistic unscoped fixture keys.tbx_01kzv9z6a4jynjxjm09eewp61r(run).git diff --checkpassed.7e3b69363ce7af370c83ca998aad8d7d0d9b8ea8.