feat(gateway): expose session resolve lineage#79962
feat(gateway): expose session resolve lineage#79962aliworksx08 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: not applicable. as a feature PR. Source inspection gives high confidence about the current behavior: main lacks Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Extend the sessionId match path to include Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR. Source inspection gives high confidence about the current behavior: main lacks Is this the best way to solve the issue? No. Adding Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 18aeac86a101. Re-review progress:
|
Summary
sessions.resolve, but they cannot ask the Gateway for canonical lineage metadata for rotated logical session families.includeLineagetosessions.resolve, return canonical lineage metadata when requested, and keep the embedded gateway stub on the same response shape.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
sessions.resolvecan now return canonical session lineage metadata for companion clients whenincludeLineage: trueis supplied.pnpm test src/gateway/sessions-resolve.test.ts src/gateway/server.sessions.preview-resolve.test.ts src/gateway/protocol/index.test.ts src/agents/tools/embedded-gateway-stub.test.ts packages/sdk/src/index.e2e.test.tsincludeLineage: truereturns the canonical key pluslineage.familyKey,lineage.currentSessionId, orderedlineage.sessionIds, and predecessor/successor ids when present.sessions.resolvereturned only{ ok: true, key }.Regression Test Plan (if applicable)
src/gateway/sessions-resolve.test.tssrc/gateway/server.sessions.preview-resolve.test.tssrc/agents/tools/embedded-gateway-stub.test.tsincludeLineage: true, preserve exact key resolution behavior, and keep embedded gateway responses aligned with the Gateway RPC surface.User-visible / Behavior Changes
Gateway clients can now pass
includeLineage: truetosessions.resolveto receive canonical session lineage metadata.Repro + Verification
Environment
Steps
Resolve a stored session without includeLineage.
Resolve the same stored session with includeLineage: true.
Verify Gateway RPC and embedded gateway paths preserve the same response contract.
Expected
Default response remains { ok: true, key }.
includeLineage: true adds canonical lineage metadata when the session row has a session id.
Embedded gateway and Gateway RPC responses stay aligned.
Actual
Matches expected.
Evidence
pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/gateway/sessions-resolve.ts src/gateway/sessions-resolve.test.ts src/gateway/server-methods/sessions.ts src/gateway/server.sessions.preview-resolve.test.ts src/gateway/protocol/schema/sessions.ts src/agents/tools/embedded-gateway-stub.ts src/agents/tools/embedded-gateway-stub.runtime.ts src/agents/tools/embedded-gateway-stub.test.ts docs/gateway/protocol.md docs/concepts/session.md
pnpm test src/gateway/sessions-resolve.test.ts src/gateway/server.sessions.preview-resolve.test.ts src/gateway/protocol/index.test.ts src/agents/tools/embedded-gateway-stub.test.ts packages/sdk/src/index.e2e.test.ts
git diff --check