mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-10 03:08:10 +02:00
fix(runner): carry steering identity into Hermes parent
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
660770f38c
commit
3fce49c5b9
2 files changed
+14
-1
No files matched your search
@@ -2050,6 +2050,12 @@ it("restores provider identity and streamed text from a canonical delta", () =>
|
||||
.toMatchObject({ threadId: "root-thread", turnId: "provider-turn", delta: "Reading Gmail", itemId: "message-1" });
|
||||
});
|
||||
|
||||
it("keeps a flat steering acknowledgement recognizable for deduplication", () => {
|
||||
const receipt = { kind: "steering_acknowledgement", correlationId: "steer-1", status: "accepted" };
|
||||
expect(rehydrateRunnerdItemNotification(receipt, "opened-thread", "provider-turn"))
|
||||
.toEqual({ ...receipt, threadId: "opened-thread", turnId: "provider-turn" });
|
||||
});
|
||||
|
||||
it("rehydrates a canonical agent item for the strict Codex facade", () => {
|
||||
expect(
|
||||
rehydrateRunnerdItemNotification(
|
||||
|
||||
@@ -1886,6 +1886,11 @@ export function rehydrateRunnerdItemNotification(
|
||||
activeTurnId: string,
|
||||
): Record<string, unknown> {
|
||||
const rawItem = record(rawParams.item);
|
||||
if (rawParams.kind === "steering_acknowledgement" && Object.keys(rawItem).length === 0) {
|
||||
// Preserve runnerd's flat receipt so the driver recognizes the transport
|
||||
// echo. The acknowledged request emits the user-visible bound item once.
|
||||
return { ...rawParams, threadId: openedThreadId, turnId: activeTurnId };
|
||||
}
|
||||
const channel = rawItem.channel ?? rawParams.channel;
|
||||
const providerPhase = rawItem.phase ?? rawParams.providerPhase;
|
||||
const phase =
|
||||
@@ -3663,7 +3668,9 @@ class DurablePrpCodexTransport implements CodexAppServerTransport {
|
||||
"turn.steer",
|
||||
{
|
||||
text,
|
||||
turnId: this.#durableTurnId,
|
||||
// ACPX owns the requested provider turn, which can differ from the
|
||||
// durable PRP turn that scopes control-plane and semantic events.
|
||||
turnId: this.options.provider === "acpx" ? expectedTurnId : this.#durableTurnId,
|
||||
providerTurnId: expectedTurnId,
|
||||
...(params.mode === "follow_up" ? { mode: "follow_up" } : {}),
|
||||
...(correlationId ? { correlationId } : {}),
|
||||
|
||||
Reference in new issue
Block a user