@parall/agent-core 1.50.1 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dispatch-adapter.d.ts +78 -1
- package/dist/dispatch-adapter.d.ts.map +1 -1
- package/dist/gateway-base.d.ts +29 -7
- package/dist/gateway-base.d.ts.map +1 -1
- package/dist/gateway-base.js +145 -34
- package/dist/gateway-lane-flow.d.ts +9 -3
- package/dist/gateway-lane-flow.d.ts.map +1 -1
- package/dist/gateway-lane-flow.js +50 -18
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lane-ledger.d.ts +66 -2
- package/dist/lane-ledger.d.ts.map +1 -1
- package/dist/lane-ledger.js +151 -8
- package/dist/redact.d.ts +18 -0
- package/dist/redact.d.ts.map +1 -0
- package/dist/redact.js +40 -0
- package/dist/skills/parall-clips.d.ts +1 -1
- package/dist/skills/parall-clips.d.ts.map +1 -1
- package/dist/skills/parall-clips.js +45 -5
- package/dist/telemetry.d.ts +6 -4
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +77 -6
- package/package.json +2 -2
- package/src/dispatch-adapter.ts +96 -2
- package/src/gateway-base.ts +171 -39
- package/src/gateway-lane-flow.ts +65 -19
- package/src/index.ts +3 -0
- package/src/lane-ledger.ts +197 -9
- package/src/redact.ts +46 -0
- package/src/skills/parall-clips.ts +45 -5
- package/src/telemetry.ts +70 -5
|
@@ -30,6 +30,46 @@ export type DispatchContext = {
|
|
|
30
30
|
client: ParallClient;
|
|
31
31
|
log?: GatewayLogger;
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Normalized LLM-layer classification of how a turn ended. Detection is the
|
|
35
|
+
* runtime bridge's job (structured fields first, heuristics second, message
|
|
36
|
+
* regex last); the gateway and server only ever consume this enum. Design:
|
|
37
|
+
* docs/engineering-design/agent-turn-outcome-design.md.
|
|
38
|
+
*/
|
|
39
|
+
export type TurnOutcomeClass = 'ok' | 'usage_limit' | 'auth' | 'context_overflow' | 'api_error' | 'runtime_crash';
|
|
40
|
+
/** Per-turn usage/cost accounting, populated when the runtime reports it. */
|
|
41
|
+
export type TurnUsage = {
|
|
42
|
+
inputTokens?: number;
|
|
43
|
+
outputTokens?: number;
|
|
44
|
+
cacheReadTokens?: number;
|
|
45
|
+
cacheCreationTokens?: number;
|
|
46
|
+
costUsd?: number;
|
|
47
|
+
durationMs?: number;
|
|
48
|
+
durationApiMs?: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Turn-boundary summary event: at most ONE per turn, emitted by the bridge
|
|
52
|
+
* right before its dispatch generator returns. Additive to the RuntimeEvent
|
|
53
|
+
* contract — runtimes that don't emit it keep the legacy boolean error path.
|
|
54
|
+
*/
|
|
55
|
+
export type TurnOutcomeEvent = {
|
|
56
|
+
type: 'turn_outcome';
|
|
57
|
+
outcome: TurnOutcomeClass;
|
|
58
|
+
/** Human-readable evidence (original error/limit text), truncated by the bridge. */
|
|
59
|
+
detail?: string;
|
|
60
|
+
/** ISO 8601 retry hint; only meaningful for usage_limit (parsed reset time). */
|
|
61
|
+
retryAt?: string;
|
|
62
|
+
usage?: TurnUsage;
|
|
63
|
+
/** Model the runtime reports it actually used this turn. */
|
|
64
|
+
model?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Runtime-native discriminator snapshot (telemetry/step only, never logic).
|
|
67
|
+
* Scalar leaves only: redactTurnOutcome masks top-level strings, so a nested
|
|
68
|
+
* object could smuggle credential-shaped values past redaction into the
|
|
69
|
+
* `dispatch.outcome_raw` span. Keep this a flat scalar map by construction.
|
|
70
|
+
*/
|
|
71
|
+
raw?: Record<string, string | number | boolean | null>;
|
|
72
|
+
};
|
|
33
73
|
export type RuntimeEvent = {
|
|
34
74
|
type: 'runtime_session';
|
|
35
75
|
runtimeSessionId: string;
|
|
@@ -62,6 +102,19 @@ export type RuntimeEvent = {
|
|
|
62
102
|
} | {
|
|
63
103
|
type: 'error';
|
|
64
104
|
message: string;
|
|
105
|
+
} | TurnOutcomeEvent;
|
|
106
|
+
/**
|
|
107
|
+
* The gateway's settled view of a turn for the ledger complete: undefined
|
|
108
|
+
* (clean), an error to release members on the redrive budget, or a deferred
|
|
109
|
+
* usage-limit wait to re-deliver at retryAt without burning budget.
|
|
110
|
+
*/
|
|
111
|
+
export type SettledTurnOutcome = {
|
|
112
|
+
kind: 'error';
|
|
113
|
+
outcomeClass?: TurnOutcomeClass;
|
|
114
|
+
} | {
|
|
115
|
+
kind: 'deferred';
|
|
116
|
+
outcomeClass: 'usage_limit';
|
|
117
|
+
retryAt?: string;
|
|
65
118
|
};
|
|
66
119
|
/**
|
|
67
120
|
* Cross-runtime error-step contract: an execution error surfaces as a `text`
|
|
@@ -82,6 +135,24 @@ export type DispatchOpts = {
|
|
|
82
135
|
bodyForAgent: string;
|
|
83
136
|
sessionKey: string;
|
|
84
137
|
context: DispatchContext;
|
|
138
|
+
inputLifecycle?: DispatchInputLifecycle;
|
|
139
|
+
};
|
|
140
|
+
export type RuntimeInputState = 'started' | 'completed' | 'failed';
|
|
141
|
+
export type RuntimeInputUpdateResult = {
|
|
142
|
+
/**
|
|
143
|
+
* True only when a failed input was actually released server-side and its
|
|
144
|
+
* buffered copy must become real retry work.
|
|
145
|
+
*/
|
|
146
|
+
retry: boolean;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Exact server WorkItems represented by one runtime input frame. The adapter
|
|
150
|
+
* must await update() before exposing output that depends on that transition.
|
|
151
|
+
*/
|
|
152
|
+
export type DispatchInputLifecycle = {
|
|
153
|
+
deliveryKey: string;
|
|
154
|
+
dispatchEventIds: string[];
|
|
155
|
+
update: (state: RuntimeInputState) => Promise<RuntimeInputUpdateResult | void>;
|
|
85
156
|
};
|
|
86
157
|
export type ForkSessionHandle = {
|
|
87
158
|
sessionKey: string;
|
|
@@ -99,6 +170,12 @@ export type CleanupForkOpts = {
|
|
|
99
170
|
export interface DispatchAdapter {
|
|
100
171
|
/** Dispatch a Parall event to the runtime and emit normalized runtime events. */
|
|
101
172
|
dispatch(opts: DispatchOpts): AsyncIterable<RuntimeEvent>;
|
|
173
|
+
/**
|
|
174
|
+
* Opt into exact per-input coverage. The gateway claims explicit lanes and
|
|
175
|
+
* passes lifecycle callbacks to dispatch/enqueueDuringDispatch. An adapter
|
|
176
|
+
* setting this must fail closed when its runtime cannot prove lifecycle.
|
|
177
|
+
*/
|
|
178
|
+
inputLifecycleMode?: 'explicit';
|
|
102
179
|
/**
|
|
103
180
|
* True when dispatch() presents `earlierEvents` to the model itself (e.g.
|
|
104
181
|
* OpenClaw maps them into native InboundHistory). The gateway then must
|
|
@@ -122,7 +199,7 @@ export interface DispatchAdapter {
|
|
|
122
199
|
* must detect the pending injection (skip the duplicate input) and only
|
|
123
200
|
* consume output produced in response.
|
|
124
201
|
*/
|
|
125
|
-
enqueueDuringDispatch?(sessionKey: string, body: string): boolean | Promise<boolean>;
|
|
202
|
+
enqueueDuringDispatch?(sessionKey: string, body: string, inputLifecycle?: DispatchInputLifecycle): boolean | Promise<boolean>;
|
|
126
203
|
/** True if enqueueDuringDispatch was called and the injections have not yet been consumed by dispatch(). */
|
|
127
204
|
hasPendingInjections?(sessionKey: string): boolean;
|
|
128
205
|
/** Fork the current runtime session for concurrent handling. Return null to buffer on main. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-adapter.d.ts","sourceRoot":"","sources":["../src/dispatch-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,EAAE,CAA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AIG;IACH,kBAAkB,CAAC,EAAE,UAAU,CAAC;IAEhC;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CAAC,CACpB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,sBAAsB,GACtC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9B,4GAA4G;IAC5G,oBAAoB,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAEnD,+FAA+F;IAC/F,WAAW,CAAC,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,GAAG,iBAAiB,GAAG,IAAI,CAAC;IAE3F,wDAAwD;IACxD,WAAW,CAAC,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE1D,6FAA6F;IAC7F,cAAc,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAExD,yFAAyF;IACzF,qBAAqB,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAE/D;;;;;OAKG;IACH,aAAa,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C"}
|
package/dist/gateway-base.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParallClient, ParallWs } from '@parall/sdk';
|
|
2
2
|
import type { AgentConfigUpdateData } from '@parall/sdk';
|
|
3
|
-
import { type DispatchAdapter, type GatewayLogger } from './dispatch-adapter.js';
|
|
3
|
+
import { type DispatchAdapter, type GatewayLogger, type SettledTurnOutcome } from './dispatch-adapter.js';
|
|
4
4
|
import type { ParallEvent } from './types.js';
|
|
5
5
|
export type DispatchableMessage = {
|
|
6
6
|
id: string;
|
|
@@ -170,16 +170,38 @@ export declare class ParallAgentGateway {
|
|
|
170
170
|
* No-op without an active ledger lane for the session.
|
|
171
171
|
*/
|
|
172
172
|
touchRuntimeActivity(sessionKey: string): void;
|
|
173
|
-
/** Sessions whose in-flight turn surfaced a runtime error event. */
|
|
174
|
-
private turnErrorSessions;
|
|
175
173
|
/**
|
|
176
|
-
*
|
|
174
|
+
* Settled LLM-layer outcome of each session's last turn — an error to
|
|
175
|
+
* release lane members on the redrive budget, or a deferred usage-limit
|
|
176
|
+
* wait (agent-turn-outcome-design.md). Absent = clean turn.
|
|
177
|
+
*/
|
|
178
|
+
private turnOutcomes;
|
|
179
|
+
/**
|
|
180
|
+
* Consume (read-and-clear) the settled outcome for sessionKey's last turn.
|
|
177
181
|
* Feeds complete's turn_outcome so an error turn's lane members are
|
|
178
|
-
* released for retry
|
|
179
|
-
*
|
|
180
|
-
*
|
|
182
|
+
* released for retry (and a deferred turn's members re-deliver at retryAt)
|
|
183
|
+
* instead of being no_action-swept (design §3). Consuming (rather than
|
|
184
|
+
* peeking) keeps one-shot fork session keys from accumulating forever.
|
|
185
|
+
*/
|
|
186
|
+
consumeTurnOutcome(sessionKey: string): SettledTurnOutcome | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Boolean view of consumeTurnOutcome for the typed/fork call sites, which
|
|
189
|
+
* have no deferred semantics: ANY non-clean outcome (error or deferred)
|
|
190
|
+
* counts as an errored turn there — release-for-retry beats a false
|
|
191
|
+
* "handled".
|
|
181
192
|
*/
|
|
182
193
|
consumeTurnError(sessionKey: string): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Fold turn signals into the session's settled outcome. Two sources, one
|
|
196
|
+
* precedence rule: the bridge's explicit turn_outcome classification always
|
|
197
|
+
* wins (it may refine the SAME failure a generic `error` event already
|
|
198
|
+
* reported — e.g. Claude's result frame yields both), while a bare `error`
|
|
199
|
+
* event only fills the slot when no classification exists. Wire order makes
|
|
200
|
+
* this safe: every bridge emits its error events before the turn-boundary
|
|
201
|
+
* turn_outcome.
|
|
202
|
+
*/
|
|
203
|
+
private recordTurnErrorSignal;
|
|
204
|
+
private recordTurnClassification;
|
|
183
205
|
private emitDispatchReceived;
|
|
184
206
|
/**
|
|
185
207
|
* Sticky: the server answered a by-id complete with 400 (predates the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-base.d.ts","sourceRoot":"","sources":["../src/gateway-base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgC,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,KAAK,EACV,qBAAqB,EAkBtB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAGL,KAAK,eAAe,EAGpB,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"gateway-base.d.ts","sourceRoot":"","sources":["../src/gateway-base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgC,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,KAAK,EACV,qBAAqB,EAkBtB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAGL,KAAK,eAAe,EAGpB,KAAK,aAAa,EAElB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AA+C/B,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAwB7D,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SA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oBAAoB;IAsB5B,OAAO,CAAC,qBAAqB;YAQf,eAAe;YAiEf,iBAAiB;IAiH/B,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,0BAA0B;IAWlC,kEAAkE;IAClE,OAAO,CAAC,eAAe;IASvB,kEAAkE;IAClE,OAAO,CAAC,eAAe;YAQT,gCAAgC;YAMhC,kBAAkB;YA6ElB,WAAW;IAsYzB,OAAO,CAAC,SAAS;YA6CH,gBAAgB;YAsMhB,eAAe;YAwNf,kBAAkB;YAmPlB,kBAAkB;YAkBlB,4BAA4B;YAuF5B,aAAa;YAmCb,oBAAoB;YAapB,2BAA2B;IAkBzC,OAAO,CAAC,sBAAsB;YAQhB,oBAAoB;YA0CpB,kBAAkB;YAwBlB,iBAAiB;YAuFjB,iBAAiB;IA6E/B;;;;;;;OAOG;YACW,0BAA0B;YA4B1B,kBAAkB;YA2ClB,gCAAgC;YA6BhC,4BAA4B;YA2G5B,wBAAwB;YA+CxB,6BAA6B;YA6D7B,mBAAmB;IAuOjC,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,SAAS;YAQH,WAAW;IAkEzB,OAAO,CAAC,YAAY;YAiBN,QAAQ;CAgEvB"}
|
package/dist/gateway-base.js
CHANGED
|
@@ -6,15 +6,16 @@ import { ApiError, mentionTargetsUser } from '@parall/sdk';
|
|
|
6
6
|
import { buildEventBody, buildEventBodyForForkResult, buildForkResultPrefix, buildForkScopePrefix, } from './event-format.js';
|
|
7
7
|
import { CAPABILITY_SLACK_SEND, channelCapabilityKeyFor } from './channel-capability.js';
|
|
8
8
|
import { buildErrorStepContent, } from './dispatch-adapter.js';
|
|
9
|
-
import { clearTypedDedupeForEvent, consumeMessageWorkItem, consumeTypedDispatch, dispatchLaneGroup, resolveDispatchByID, settleDrainedTypedGroup, typedLedgerEventIds, } from './gateway-lane-flow.js';
|
|
10
|
-
import { LaneLedger } from './lane-ledger.js';
|
|
9
|
+
import { clearTypedDedupeForEvent, consumeMessageWorkItem, consumeTypedDispatch, dispatchLaneGroup, resolveDispatchByID, settleDrainedTypedGroup, steerLaneMessage, typedLedgerEventIds, } from './gateway-lane-flow.js';
|
|
10
|
+
import { LaneLedger, bindLaneSession, releaseLocalMessageClaims } from './lane-ledger.js';
|
|
11
11
|
import { routeTrigger } from './routing.js';
|
|
12
|
+
import { redactTurnOutcome } from './redact.js';
|
|
12
13
|
import { StepPersister, isRetryableStepError } from './step-persister.js';
|
|
13
14
|
import { SessionLifecycleCoordinator } from './session-lifecycle.js';
|
|
14
15
|
import { ForkSessionFinalizer } from './fork-session-finalizer.js';
|
|
15
16
|
import { clearDispatchMessageId, clearDispatchMetrics, clearDispatchNoReply, clearSessionMessageId, getDispatchMetrics, recordDeliverText, recordMessageSend, recordNoReply, recordToolCall, resetDispatchMetrics, setDispatchMessageId, setDispatchNoReply, setSessionChatId, setSessionMessageId, } from './session-state.js';
|
|
16
17
|
import { isParallSendCommand, isParallNoReplyCommand, extractShellCommand, } from './bridge-workspace.js';
|
|
17
|
-
import { startDispatchSpan, endDispatchSpan, recordDispatchMetric, recordMissingReply, runWithSessionKey, } from './telemetry.js';
|
|
18
|
+
import { startDispatchSpan, endDispatchSpan, recordDispatchMetric, recordMissingReply, recordTurnUsage, runWithSessionKey, } from './telemetry.js';
|
|
18
19
|
const LIVE_SESSION_STATUSES = new Set(['open', 'active', 'idle']);
|
|
19
20
|
// Parse PRLL_SHUTDOWN_DEADLINE_MS (or any string env value) into a positive
|
|
20
21
|
// integer milliseconds value, or undefined if unset/invalid. Runtimes pass
|
|
@@ -222,6 +223,8 @@ export class ParallAgentGateway {
|
|
|
222
223
|
orgId: opts.config.org_id,
|
|
223
224
|
contextDir: opts.dispatchContextDir,
|
|
224
225
|
log: opts.log,
|
|
226
|
+
coverageMode: opts.dispatchAdapter.inputLifecycleMode ?? 'implicit',
|
|
227
|
+
releaseLocalClaims: (sourceIds) => releaseLocalMessageClaims(this.dispatchedMessages, sourceIds),
|
|
225
228
|
});
|
|
226
229
|
}
|
|
227
230
|
this.SHUTDOWN_DEADLINE_MS = opts.shutdownDeadlineMs ?? 60_000;
|
|
@@ -553,17 +556,49 @@ export class ParallAgentGateway {
|
|
|
553
556
|
if (laneKey)
|
|
554
557
|
this.laneLedger?.renewByKey(laneKey);
|
|
555
558
|
}
|
|
556
|
-
/** Sessions whose in-flight turn surfaced a runtime error event. */
|
|
557
|
-
turnErrorSessions = new Set();
|
|
558
559
|
/**
|
|
559
|
-
*
|
|
560
|
+
* Settled LLM-layer outcome of each session's last turn — an error to
|
|
561
|
+
* release lane members on the redrive budget, or a deferred usage-limit
|
|
562
|
+
* wait (agent-turn-outcome-design.md). Absent = clean turn.
|
|
563
|
+
*/
|
|
564
|
+
turnOutcomes = new Map();
|
|
565
|
+
/**
|
|
566
|
+
* Consume (read-and-clear) the settled outcome for sessionKey's last turn.
|
|
560
567
|
* Feeds complete's turn_outcome so an error turn's lane members are
|
|
561
|
-
* released for retry
|
|
562
|
-
*
|
|
563
|
-
*
|
|
568
|
+
* released for retry (and a deferred turn's members re-deliver at retryAt)
|
|
569
|
+
* instead of being no_action-swept (design §3). Consuming (rather than
|
|
570
|
+
* peeking) keeps one-shot fork session keys from accumulating forever.
|
|
571
|
+
*/
|
|
572
|
+
consumeTurnOutcome(sessionKey) {
|
|
573
|
+
const outcome = this.turnOutcomes.get(sessionKey);
|
|
574
|
+
this.turnOutcomes.delete(sessionKey);
|
|
575
|
+
return outcome;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Boolean view of consumeTurnOutcome for the typed/fork call sites, which
|
|
579
|
+
* have no deferred semantics: ANY non-clean outcome (error or deferred)
|
|
580
|
+
* counts as an errored turn there — release-for-retry beats a false
|
|
581
|
+
* "handled".
|
|
564
582
|
*/
|
|
565
583
|
consumeTurnError(sessionKey) {
|
|
566
|
-
return this.
|
|
584
|
+
return this.consumeTurnOutcome(sessionKey) !== undefined;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Fold turn signals into the session's settled outcome. Two sources, one
|
|
588
|
+
* precedence rule: the bridge's explicit turn_outcome classification always
|
|
589
|
+
* wins (it may refine the SAME failure a generic `error` event already
|
|
590
|
+
* reported — e.g. Claude's result frame yields both), while a bare `error`
|
|
591
|
+
* event only fills the slot when no classification exists. Wire order makes
|
|
592
|
+
* this safe: every bridge emits its error events before the turn-boundary
|
|
593
|
+
* turn_outcome.
|
|
594
|
+
*/
|
|
595
|
+
recordTurnErrorSignal(sessionKey) {
|
|
596
|
+
if (!this.turnOutcomes.has(sessionKey)) {
|
|
597
|
+
this.turnOutcomes.set(sessionKey, { kind: 'error' });
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
recordTurnClassification(sessionKey, next) {
|
|
601
|
+
this.turnOutcomes.set(sessionKey, next);
|
|
567
602
|
}
|
|
568
603
|
async emitDispatchReceived(event) {
|
|
569
604
|
const sourceType = event.ackSourceType ?? (event.type === 'task' ? 'task_activity' : 'message');
|
|
@@ -778,7 +813,14 @@ export class ParallAgentGateway {
|
|
|
778
813
|
}
|
|
779
814
|
: event.type === 'approval'
|
|
780
815
|
? { approval_id: event.messageId }
|
|
781
|
-
: {
|
|
816
|
+
: {
|
|
817
|
+
message_id: event.messageId,
|
|
818
|
+
// Thread context for the session→chat backlink:
|
|
819
|
+
// a thread reply can only be navigated to with
|
|
820
|
+
// its thread root (the chat surface rejects
|
|
821
|
+
// bare thread-message targets).
|
|
822
|
+
...(event.threadRootId ? { thread_root_id: event.threadRootId } : {}),
|
|
823
|
+
},
|
|
782
824
|
sender_id: event.senderId,
|
|
783
825
|
sender_name: event.senderName,
|
|
784
826
|
summary: event.body.substring(0, 200),
|
|
@@ -1003,7 +1045,7 @@ export class ParallAgentGateway {
|
|
|
1003
1045
|
// are shutting down. Callers MUST treat `false` as "not dispatched" and
|
|
1004
1046
|
// skip the server-side ack so the event stays in the dispatch queue for
|
|
1005
1047
|
// catch-up on the replacement pod — otherwise we silently drop work.
|
|
1006
|
-
async runDispatch(event, sessionKey, bodyForAgent, earlierEvents = [], captureText) {
|
|
1048
|
+
async runDispatch(event, sessionKey, bodyForAgent, earlierEvents = [], captureText, inputLifecycle) {
|
|
1007
1049
|
// Graceful shutdown: once SIGTERM has fired we stop accepting new work.
|
|
1008
1050
|
// In-flight dispatches that started before the flag flipped keep running
|
|
1009
1051
|
// and are awaited by shutdown() up to SHUTDOWN_DEADLINE_MS.
|
|
@@ -1016,7 +1058,7 @@ export class ParallAgentGateway {
|
|
|
1016
1058
|
this.pendingRestartNotification = null;
|
|
1017
1059
|
}
|
|
1018
1060
|
resetDispatchMetrics(sessionKey);
|
|
1019
|
-
this.
|
|
1061
|
+
this.turnOutcomes.delete(sessionKey);
|
|
1020
1062
|
return runWithSessionKey(sessionKey, async () => {
|
|
1021
1063
|
let dispatchSpan = null;
|
|
1022
1064
|
setSessionChatId(sessionKey, event.targetId);
|
|
@@ -1072,6 +1114,8 @@ export class ParallAgentGateway {
|
|
|
1072
1114
|
let inputStepsCreated = false;
|
|
1073
1115
|
let turnHandle;
|
|
1074
1116
|
let dispatchError;
|
|
1117
|
+
let turnOutcomeEvent;
|
|
1118
|
+
let sawErrorEvent = false;
|
|
1075
1119
|
const pendingSendCallIds = new Set();
|
|
1076
1120
|
// Turn boundary: must complete one bounded active reconciliation
|
|
1077
1121
|
// BEFORE this turn's first AgentStep persists — a reused idle session
|
|
@@ -1092,10 +1136,18 @@ export class ParallAgentGateway {
|
|
|
1092
1136
|
bodyForAgent,
|
|
1093
1137
|
sessionKey,
|
|
1094
1138
|
context: dispatchContext,
|
|
1139
|
+
inputLifecycle,
|
|
1095
1140
|
})) {
|
|
1096
1141
|
if (runtimeEvent.type === 'runtime_session') {
|
|
1097
1142
|
const priorAgentSessionId = binding?.agentSessionId;
|
|
1098
1143
|
binding = await this.bindRuntimeSession(sessionKey, runtimeEvent, contextFilePath, laneContextFilePath);
|
|
1144
|
+
if (activeLane) {
|
|
1145
|
+
// Session attribution for the lane's complete sweep (the server
|
|
1146
|
+
// validates ownership; informational). bindLaneSession flips
|
|
1147
|
+
// sticky-ambiguous on a session rotation instead of blaming
|
|
1148
|
+
// the newest session.
|
|
1149
|
+
bindLaneSession(activeLane, binding.agentSessionId);
|
|
1150
|
+
}
|
|
1099
1151
|
if (event.targetType === 'channel_conversation' &&
|
|
1100
1152
|
binding.agentSessionId !== priorAgentSessionId) {
|
|
1101
1153
|
// Record the durable chv_ ↔ ase_ mapping (ops drill-down from a
|
|
@@ -1122,6 +1174,57 @@ export class ParallAgentGateway {
|
|
|
1122
1174
|
}
|
|
1123
1175
|
continue;
|
|
1124
1176
|
}
|
|
1177
|
+
if (runtimeEvent.type === 'turn_outcome') {
|
|
1178
|
+
// Turn-boundary summary (at most one per turn): capture for the
|
|
1179
|
+
// finally-block telemetry, fold non-ok classes into the settled
|
|
1180
|
+
// outcome the ledger complete consumes, and surface non-ok turns
|
|
1181
|
+
// as an error step so limit/auth failures are visible in the
|
|
1182
|
+
// session panel instead of vanishing as a silent no_action
|
|
1183
|
+
// (agent-turn-outcome-design.md §5).
|
|
1184
|
+
// detail/raw echo provider error bodies — redact before the event
|
|
1185
|
+
// reaches any sink (step, log, telemetry).
|
|
1186
|
+
const outcomeEvent = redactTurnOutcome(runtimeEvent, [this.opts.config.api_key]);
|
|
1187
|
+
turnOutcomeEvent = outcomeEvent;
|
|
1188
|
+
if (outcomeEvent.outcome === 'ok') {
|
|
1189
|
+
// Authoritative boundary verdict: an explicit ok clears any
|
|
1190
|
+
// generic error-event marker recorded earlier this turn (e.g.
|
|
1191
|
+
// codex's broadcast `error` notification followed by a
|
|
1192
|
+
// successful turn/completed) — completing the lane as an error
|
|
1193
|
+
// would redrive successfully handled work.
|
|
1194
|
+
this.turnOutcomes.delete(sessionKey);
|
|
1195
|
+
continue;
|
|
1196
|
+
}
|
|
1197
|
+
this.recordTurnClassification(sessionKey, outcomeEvent.outcome === 'usage_limit'
|
|
1198
|
+
? {
|
|
1199
|
+
kind: 'deferred',
|
|
1200
|
+
outcomeClass: outcomeEvent.outcome,
|
|
1201
|
+
...(outcomeEvent.retryAt ? { retryAt: outcomeEvent.retryAt } : {}),
|
|
1202
|
+
}
|
|
1203
|
+
: { kind: 'error', outcomeClass: outcomeEvent.outcome });
|
|
1204
|
+
const retryNote = outcomeEvent.retryAt ? `, retry at ${outcomeEvent.retryAt}` : '';
|
|
1205
|
+
this.opts.log?.warn(`turn outcome: ${outcomeEvent.outcome}${retryNote}${outcomeEvent.detail ? ` — ${outcomeEvent.detail}` : ''}`);
|
|
1206
|
+
if (binding) {
|
|
1207
|
+
// Same lifecycle ordering as every other step-producing event:
|
|
1208
|
+
// the turn must have begun and the input steps must exist
|
|
1209
|
+
// before the outcome step persists — an outcome-first turn
|
|
1210
|
+
// (e.g. openclaw pushing the classification as its only event
|
|
1211
|
+
// on a reused session) must not write a step into an idle
|
|
1212
|
+
// session (review round 2 P2).
|
|
1213
|
+
await ensureTurnBegun();
|
|
1214
|
+
if (!inputStepsCreated) {
|
|
1215
|
+
if (earlierEvents.length > 0) {
|
|
1216
|
+
await this.createInputStepsForEarlierEvents(binding.agentSessionId, earlierEvents);
|
|
1217
|
+
}
|
|
1218
|
+
await this.createInputStep(binding.agentSessionId, event);
|
|
1219
|
+
inputStepsCreated = true;
|
|
1220
|
+
}
|
|
1221
|
+
await this.createRuntimeStep(binding.agentSessionId, event, {
|
|
1222
|
+
type: 'error',
|
|
1223
|
+
message: `LLM turn ${outcomeEvent.outcome}${retryNote}${outcomeEvent.detail ? `: ${outcomeEvent.detail}` : ''}`,
|
|
1224
|
+
}, stepIdFilePath, contextFilePath, laneContextFilePath);
|
|
1225
|
+
}
|
|
1226
|
+
continue;
|
|
1227
|
+
}
|
|
1125
1228
|
if (!binding) {
|
|
1126
1229
|
const detail = runtimeEvent.type === 'error' ? `: ${runtimeEvent.message}` : '';
|
|
1127
1230
|
throw new Error(`runtime emitted ${runtimeEvent.type} before runtime_session${detail}`);
|
|
@@ -1161,7 +1264,11 @@ export class ParallAgentGateway {
|
|
|
1161
1264
|
recordMessageSend(sessionKey, !runtimeEvent.error);
|
|
1162
1265
|
}
|
|
1163
1266
|
if (runtimeEvent.type === 'error') {
|
|
1164
|
-
|
|
1267
|
+
sawErrorEvent = true;
|
|
1268
|
+
// Legacy signal (runtimes without a turn_outcome event, and the
|
|
1269
|
+
// pre-boundary error frames of runtimes with one). Fills the
|
|
1270
|
+
// settled slot only when no explicit classification exists.
|
|
1271
|
+
this.recordTurnErrorSignal(sessionKey);
|
|
1165
1272
|
}
|
|
1166
1273
|
await this.createRuntimeStep(binding.agentSessionId, event, runtimeEvent, stepIdFilePath, contextFilePath, laneContextFilePath);
|
|
1167
1274
|
}
|
|
@@ -1219,8 +1326,13 @@ export class ParallAgentGateway {
|
|
|
1219
1326
|
clearTimeout(deadlineTimer);
|
|
1220
1327
|
const metricsSnapshot = getDispatchMetrics(sessionKey);
|
|
1221
1328
|
const durationMs = metricsSnapshot ? Date.now() - metricsSnapshot.started_at : 0;
|
|
1222
|
-
|
|
1223
|
-
|
|
1329
|
+
// Effective outcome for telemetry: the bridge's turn_outcome wins;
|
|
1330
|
+
// otherwise a thrown dispatch / legacy error event classifies as
|
|
1331
|
+
// runtime_crash, and a quiet turn is ok.
|
|
1332
|
+
const effectiveOutcome = turnOutcomeEvent?.outcome ?? (dispatchError || sawErrorEvent ? 'runtime_crash' : 'ok');
|
|
1333
|
+
endDispatchSpan(dispatchSpan, metricsSnapshot, dispatchError, turnOutcomeEvent);
|
|
1334
|
+
recordDispatchMetric(event, this.opts.runtimeType, durationMs, effectiveOutcome);
|
|
1335
|
+
recordTurnUsage(turnOutcomeEvent?.usage, this.opts.runtimeType);
|
|
1224
1336
|
if (metricsSnapshot &&
|
|
1225
1337
|
!dispatchError &&
|
|
1226
1338
|
event.type === 'message' &&
|
|
@@ -1229,7 +1341,7 @@ export class ParallAgentGateway {
|
|
|
1229
1341
|
metricsSnapshot.deliver_text_chunks > 0 &&
|
|
1230
1342
|
metricsSnapshot.message_send_successes === 0 &&
|
|
1231
1343
|
!metricsSnapshot.no_reply_called) {
|
|
1232
|
-
recordMissingReply(this.opts.runtimeType);
|
|
1344
|
+
recordMissingReply(this.opts.runtimeType, effectiveOutcome);
|
|
1233
1345
|
}
|
|
1234
1346
|
clearDispatchMetrics(sessionKey);
|
|
1235
1347
|
if (turnHandle) {
|
|
@@ -1352,11 +1464,12 @@ export class ParallAgentGateway {
|
|
|
1352
1464
|
item.resolve(false);
|
|
1353
1465
|
break;
|
|
1354
1466
|
}
|
|
1355
|
-
if (outcome === 'failed') {
|
|
1356
|
-
// Error turn:
|
|
1357
|
-
// redelivery. Do NOT push them to
|
|
1358
|
-
// must not arrive wearing an
|
|
1359
|
-
// draining; the released work
|
|
1467
|
+
if (outcome === 'failed' || outcome === 'deferred') {
|
|
1468
|
+
// Error/deferred turn: the settlement already released (or
|
|
1469
|
+
// scheduled) the members for redelivery. Do NOT push them to
|
|
1470
|
+
// processedEvents — the redelivery must not arrive wearing an
|
|
1471
|
+
// "already handled" prefix. Keep draining; the released work
|
|
1472
|
+
// rejoins the next claim.
|
|
1360
1473
|
for (const item of items)
|
|
1361
1474
|
item.resolve(false);
|
|
1362
1475
|
continue;
|
|
@@ -1412,10 +1525,10 @@ export class ParallAgentGateway {
|
|
|
1412
1525
|
}
|
|
1413
1526
|
}
|
|
1414
1527
|
finally {
|
|
1415
|
-
// One-shot fork keys are never dispatched again — drop any
|
|
1416
|
-
// the legacy (non-ledger) path left unconsumed, or the
|
|
1417
|
-
// every failed ephemeral fork.
|
|
1418
|
-
this.
|
|
1528
|
+
// One-shot fork keys are never dispatched again — drop any settled
|
|
1529
|
+
// outcome the legacy (non-ledger) path left unconsumed, or the map
|
|
1530
|
+
// grows with every failed ephemeral fork.
|
|
1531
|
+
this.turnOutcomes.delete(fork.fork.sessionKey);
|
|
1419
1532
|
if (fork.deadlineTimer) {
|
|
1420
1533
|
clearTimeout(fork.deadlineTimer);
|
|
1421
1534
|
fork.deadlineTimer = null;
|
|
@@ -1551,10 +1664,10 @@ export class ParallAgentGateway {
|
|
|
1551
1664
|
this.dispatchState.pendingForkResults.unshift(...pendingFork);
|
|
1552
1665
|
continue;
|
|
1553
1666
|
}
|
|
1554
|
-
if (outcome === 'failed') {
|
|
1555
|
-
// Error turn settled with complete
|
|
1556
|
-
// redelivery. The fork results were
|
|
1557
|
-
// turn; keep them for the next real dispatch.
|
|
1667
|
+
if (outcome === 'failed' || outcome === 'deferred') {
|
|
1668
|
+
// Error/deferred turn settled with a non-ok complete — members
|
|
1669
|
+
// released (or scheduled) for redelivery. The fork results were
|
|
1670
|
+
// not consumed by that turn; keep them for the next real dispatch.
|
|
1558
1671
|
this.dispatchState.pendingForkResults.unshift(...pendingFork);
|
|
1559
1672
|
continue;
|
|
1560
1673
|
}
|
|
@@ -1813,10 +1926,8 @@ export class ParallAgentGateway {
|
|
|
1813
1926
|
// its own turn and folds it there.
|
|
1814
1927
|
if (!typedAheadInBuffer &&
|
|
1815
1928
|
this.mainCurrentGroupKey === this.dispatchGroupKey(event) &&
|
|
1816
|
-
this.opts.dispatchAdapter.enqueueDuringDispatch != null
|
|
1817
|
-
|
|
1818
|
-
(await this.opts.dispatchAdapter.enqueueDuringDispatch(this.opts.runtimeKey, buildEventBody(event)))) {
|
|
1819
|
-
this.opts.log?.info(`steer folded+injected for ${event.messageId} (will drain for bookkeeping)`);
|
|
1929
|
+
this.opts.dispatchAdapter.enqueueDuringDispatch != null) {
|
|
1930
|
+
await steerLaneMessage(this.laneFlowHost(), event);
|
|
1820
1931
|
}
|
|
1821
1932
|
}
|
|
1822
1933
|
else if (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ParallClient } from '@parall/sdk';
|
|
2
|
-
import type { DispatchAdapter, GatewayLogger } from './dispatch-adapter.js';
|
|
2
|
+
import type { DispatchAdapter, DispatchInputLifecycle, GatewayLogger, SettledTurnOutcome } from './dispatch-adapter.js';
|
|
3
3
|
import type { DispatchableMessage, MessageDispatchDecision } from './gateway-base.js';
|
|
4
4
|
import type { LaneLedger } from './lane-ledger.js';
|
|
5
5
|
import type { ParallEvent } from './types.js';
|
|
@@ -22,6 +22,9 @@ export interface LaneFlowHost {
|
|
|
22
22
|
shuttingDown: boolean;
|
|
23
23
|
dispatchedMessages: Set<string>;
|
|
24
24
|
dispatchedTasks: Set<string>;
|
|
25
|
+
dispatchState: {
|
|
26
|
+
mainBuffer: ParallEvent[];
|
|
27
|
+
};
|
|
25
28
|
/**
|
|
26
29
|
* Per-WorkItem failure backoff for typed dispatch consumption. A consume
|
|
27
30
|
* that ends without an ack re-arms the entry; the next attempt for the
|
|
@@ -42,17 +45,20 @@ export interface LaneFlowHost {
|
|
|
42
45
|
};
|
|
43
46
|
dispatchAdapter: DispatchAdapter;
|
|
44
47
|
agentUserId: string;
|
|
48
|
+
runtimeKey: string;
|
|
45
49
|
};
|
|
46
50
|
disableLedger(reason: string): void;
|
|
47
51
|
usesLaneLedger(event: ParallEvent): boolean;
|
|
48
52
|
emitDispatchReceived(event: ParallEvent): Promise<void>;
|
|
49
53
|
consumeTurnError(sessionKey: string): boolean;
|
|
54
|
+
consumeTurnOutcome(sessionKey: string): SettledTurnOutcome | undefined;
|
|
50
55
|
noteSessionLane(sessionKey: string, laneKey: string | null): void;
|
|
51
|
-
runDispatch(event: ParallEvent, sessionKey: string, bodyForAgent: string, earlierEvents?: ParallEvent[], captureText?: string[]): Promise<boolean>;
|
|
56
|
+
runDispatch(event: ParallEvent, sessionKey: string, bodyForAgent: string, earlierEvents?: ParallEvent[], captureText?: string[], inputLifecycle?: DispatchInputLifecycle): Promise<boolean>;
|
|
52
57
|
tryClaimMessage(id: string): boolean;
|
|
53
58
|
buildMessageDispatchDecision(chatId: string, message: DispatchableMessage): Promise<MessageDispatchDecision>;
|
|
54
59
|
handleInboundEvent(event: ParallEvent): Promise<boolean>;
|
|
55
60
|
}
|
|
61
|
+
export declare function steerLaneMessage(host: LaneFlowHost, event: ParallEvent): Promise<void>;
|
|
56
62
|
/**
|
|
57
63
|
* Dispatch one group of same-lane message events under the ledger contract:
|
|
58
64
|
* claim (or reuse) the lane, run the dispatch, then complete when no local
|
|
@@ -66,7 +72,7 @@ export declare function dispatchLaneGroup(host: LaneFlowHost, opts: {
|
|
|
66
72
|
earlier: ParallEvent[];
|
|
67
73
|
captureText?: string[];
|
|
68
74
|
hasMoreLocal: () => boolean;
|
|
69
|
-
}): Promise<'dispatched' | 'foreign' | 'shutdown' | 'failed'>;
|
|
75
|
+
}): Promise<'dispatched' | 'foreign' | 'shutdown' | 'failed' | 'deferred'>;
|
|
70
76
|
/**
|
|
71
77
|
* The WorkItem ids of a typed event group whose lifecycle the ledger owns
|
|
72
78
|
* (claimed into dsp lanes by consumeTypedDispatch), or null when the group
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-lane-flow.d.ts","sourceRoot":"","sources":["../src/gateway-lane-flow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"gateway-lane-flow.d.ts","sourceRoot":"","sources":["../src/gateway-lane-flow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;GAKG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IAC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