fix: expose deliveryContext in sessions_list

Co-authored-by: Adam Holt <mail@adamholt.co.nz>
This commit is contained in:
Peter Steinberger
2026-01-17 06:54:22 +00:00
parent 1f3a09b43b
commit a85ddf258c
3 changed files with 11 additions and 0 deletions

View File

@@ -40,6 +40,7 @@
### Fixes
- Sub-agents: normalize announce delivery origin + queue bucketing by accountId to keep multi-account routing stable. (#1061, #1058) — thanks @adam91holt.
- Sessions: include deliveryContext in sessions.list and reuse normalized delivery routing for announce/restart fallbacks. (#1058)
- Sessions: propagate deliveryContext into last-route updates to keep account/channel routing stable. (#1058)
- Gateway: honor explicit delivery targets without implicit accountId fallback; preserve lastAccountId for implicit routing.
- Gateway: avoid reusing last-to/accountId when the requested channel differs; sync deliveryContext with last route fields.
- Repo: fix oxlint config filename and move ignore pattern into config. (#1064) — thanks @connorshea.

View File

@@ -48,6 +48,7 @@ Row shape (JSON):
- `thinkingLevel`, `verboseLevel`, `systemSent`, `abortedLastRun`
- `sendPolicy` (session override if set)
- `lastChannel`, `lastTo`
- `deliveryContext` (normalized `{ channel, to, accountId }` when available)
- `transcriptPath` (best-effort path derived from store dir + sessionId)
- `messages?` (only when `messageLimit > 0`)

View File

@@ -27,6 +27,7 @@ type SessionListRow = {
channel: string;
label?: string;
displayName?: string;
deliveryContext?: { channel?: string; to?: string; accountId?: string };
updatedAt?: number | null;
sessionId?: string;
model?: string;
@@ -201,6 +202,14 @@ export function createSessionsListTool(opts?: {
channel: derivedChannel,
label: typeof entry.label === "string" ? entry.label : undefined,
displayName: typeof entry.displayName === "string" ? entry.displayName : undefined,
deliveryContext:
deliveryChannel || deliveryTo || deliveryAccountId
? {
channel: deliveryChannel,
to: deliveryTo,
accountId: deliveryAccountId,
}
: undefined,
updatedAt: typeof entry.updatedAt === "number" ? entry.updatedAt : undefined,
sessionId,
model: typeof entry.model === "string" ? entry.model : undefined,