agent-relay-runner 0.12.1 → 0.12.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-runner",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "description": "Unified provider lifecycle runner for Agent Relay",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-relay-runner",
3
3
  "description": "Thin Agent Relay runner bridge for Claude Code",
4
- "version": "0.12.1",
4
+ "version": "0.12.3",
5
5
  "agentRelayContracts": {
6
6
  "providerPluginProtocol": 1
7
7
  }
package/src/runner.ts CHANGED
@@ -1139,15 +1139,29 @@ export class AgentRunner {
1139
1139
  // and drop the rest of the turn. A seen-set is idempotent under any reshuffle.
1140
1140
  const seen = new Set<string>();
1141
1141
  const turnIdAtStart = this.currentTurnId;
1142
+ // On the first poll the new prompt usually hasn't landed in the transcript yet,
1143
+ // so extractLatestTurnSteps still returns the PRIOR (completed) turn. Seed those
1144
+ // signatures as already-seen so we don't replay last turn's reasoning/tools as
1145
+ // this turn's activity. Once our prompt lands the window resets at the new user
1146
+ // boundary and genuinely-new steps emit normally. Only seed when the transcript
1147
+ // is complete (last entry is an end_turn assistant) — otherwise we're already
1148
+ // inside the new turn and those steps are legitimately ours.
1149
+ let seeded = false;
1142
1150
  const poll = async (): Promise<void> => {
1143
1151
  let jsonl: string;
1144
1152
  try { jsonl = await readFile(transcriptPath, "utf8"); } catch { return; }
1145
1153
  let steps: ReturnType<typeof extractLatestTurnSteps>;
1146
1154
  try { steps = extractLatestTurnSteps(jsonl); } catch { return; }
1155
+ if (!seeded) {
1156
+ seeded = true;
1157
+ if (transcriptLooksComplete(jsonl)) {
1158
+ for (const s of steps) seen.add(JSON.stringify([s.type, s.label ?? "", s.text]));
1159
+ }
1160
+ }
1147
1161
  const turnId = this.currentTurnId ?? turnIdAtStart;
1148
1162
  let emitted = 0;
1149
1163
  for (const step of steps) {
1150
- const sig = `${step.type}${step.label ?? ""}${step.text}`;
1164
+ const sig = JSON.stringify([step.type, step.label ?? "", step.text]);
1151
1165
  if (seen.has(sig)) continue;
1152
1166
  seen.add(sig);
1153
1167
  emitted += 1;