@coda-console/claude 1.10.0 → 1.10.1
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/agent/session.mjs +6 -5
- package/package.json +1 -1
package/agent/session.mjs
CHANGED
|
@@ -629,15 +629,16 @@ export class ClaudeSession {
|
|
|
629
629
|
const error = failed ? claudeFailure(m.errors?.length || m.result ? errorText(m) : this.turnError?.message || errorText(m),
|
|
630
630
|
{ error: this.turnError?.error, limits: this.turnLimits, window: this.window }) : null;
|
|
631
631
|
this.turnError = null; this.turnLimits = null;
|
|
632
|
+
// A turn of Claude's own has no RPC reply to fail. End its own activity as failed with the reason, rather than
|
|
633
|
+
// saying the error as an answer and marking the work complete. The task that woke it retains its own outcome.
|
|
634
|
+
// It ends before a prompt it took in is answered: Coda opens a turn of Claude's own for what still handles then.
|
|
635
|
+
const own = this.waits.handling || this.waits.unclaimed;
|
|
636
|
+
if (own) this.waits.finished(error ? { error: error.message, title: error.data?._meta?.coda?.failure?.kind === 'quota_exhausted' ? '额度不足' : undefined } : {});
|
|
632
637
|
if (id) {
|
|
633
638
|
const outcome = this.ending ?? (failed ? { failure: error } : { stopReason: cancelled ? 'cancelled' : 'end_turn' });
|
|
634
639
|
if (this.ending || !this.steering.size) this.settle(id, outcome);
|
|
635
640
|
else { this.held = id; if (cancelled || failed) this.dropRest(outcome); }
|
|
636
|
-
} else if (
|
|
637
|
-
// A turn of Claude's own has no RPC reply to fail. End its own activity as failed with the reason, rather than
|
|
638
|
-
// saying the error as an answer and marking the work complete. The task that woke it retains its own outcome.
|
|
639
|
-
this.waits.finished(error ? { error: error.message, title: error.data?._meta?.coda?.failure?.kind === 'quota_exhausted' ? '额度不足' : undefined } : {});
|
|
640
|
-
} else if (failed && this.prompts.size) {
|
|
641
|
+
} else if (!own && failed && this.prompts.size) {
|
|
641
642
|
// A failure of the session itself names no input: none of those given can be said to have run.
|
|
642
643
|
for (const prompt of this.prompts.values()) prompt.reject(error);
|
|
643
644
|
this.prompts.clear();
|