agent-relay-runner 0.56.2 → 0.57.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/package.json
CHANGED
package/src/runner.ts
CHANGED
|
@@ -570,6 +570,7 @@ export class AgentRunner {
|
|
|
570
570
|
deliver: (messages) => this.control!.deliverToMonitor(messages),
|
|
571
571
|
},
|
|
572
572
|
};
|
|
573
|
+
const launchSeededPrompt = this.options.adapter.seedsInitialPromptAtLaunch ? this.options.prompt?.trim() : ""; if (launchSeededPrompt) this.recordInjectedPrompt(launchSeededPrompt);
|
|
573
574
|
return this.options.adapter.spawn(config);
|
|
574
575
|
}
|
|
575
576
|
|
|
@@ -617,25 +618,18 @@ export class AgentRunner {
|
|
|
617
618
|
|
|
618
619
|
private async deliverInitialPrompt(): Promise<void> {
|
|
619
620
|
const prompt = this.options.prompt?.trim();
|
|
620
|
-
if (!prompt) return;
|
|
621
|
-
// #352: adapters that seed the prompt as a launch arg (Claude's positional prompt) already
|
|
622
|
-
// delivered it at session start. Returning BEFORE attemptInitialPromptDelivery avoids a
|
|
623
|
-
// double-delivery AND leaves pendingInitialPrompt unset, so the #329 ready-signal retry never
|
|
624
|
-
// arms — one prompt, one turn. Mid-session injectPrompt + message delivery are unaffected.
|
|
625
|
-
if (this.options.adapter.seedsInitialPromptAtLaunch) return;
|
|
621
|
+
if (!prompt || this.options.adapter.seedsInitialPromptAtLaunch) return;
|
|
626
622
|
await this.attemptInitialPromptDelivery(prompt, INITIAL_PROMPT_FIRST_READY_TIMEOUT_MS);
|
|
627
623
|
}
|
|
628
624
|
|
|
629
625
|
// Deliver the spawn-time first prompt, surviving a cold-start TUI that isn't input-ready yet
|
|
630
|
-
// (#329).
|
|
631
|
-
// that looked healthy): it's stashed for a ready-signal-driven retry (setProviderStatus) and
|
|
632
|
-
// surfaced on the runner timeline, so the spawner sees a stuck delivery, not just a log line.
|
|
626
|
+
// (#329). Timeout stashes it for ready-signal retry and surfaces the stall on the timeline.
|
|
633
627
|
private async attemptInitialPromptDelivery(prompt: string, readyTimeoutMs: number): Promise<void> {
|
|
634
628
|
if (this.deliveringInitialPrompt || this.stopped || !this.process || !this.options.adapter.deliverInitialPrompt) return;
|
|
635
629
|
this.deliveringInitialPrompt = true;
|
|
636
630
|
const attempt = (this.initialPromptAttempts += 1);
|
|
637
631
|
try {
|
|
638
|
-
await this.options.adapter.deliverInitialPrompt(this.process, prompt, { readyTimeoutMs });
|
|
632
|
+
this.recordInjectedPrompt(prompt); await this.options.adapter.deliverInitialPrompt(this.process, prompt, { readyTimeoutMs });
|
|
639
633
|
this.pendingInitialPrompt = undefined;
|
|
640
634
|
} catch (error) {
|
|
641
635
|
const giveUp = attempt >= MAX_INITIAL_PROMPT_ATTEMPTS;
|