Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a usage-limited delegated child tells its parent the instance and reset time #31083

Openjuliusmarmingewants to merge 15 commits intomain fromrefs/pull/31083/headopened View on GitHub

Showing 5 changed files with 62 additions and 0 deletions (loading 2).

x
0 of 5 viewed, 5 left
43 additions and 0 deletionsapps/server/src/orchestration-v2/SubagentProjection.test.tsModified
View file
@@ -378,6 +378,49 @@
assert.isNull(result.messageId);
});
​
+it("tells the parent which provider instance hit a usage limit and when it resets", () => {
+ const { projection, run } = taskFixture();
+ const failedRun = {
+ ...run,
+ status: "failed" as const,
+ providerInstanceId: ProviderInstanceId.make("work-a"),
+ };
+ const artifacts = makeSubagentConversationArtifacts({
+ messageId: MessageId.make("limited"),
+ turnItemId: TurnItemId.make("limited-error"),
+ threadId: parentThreadId,
+ rootNodeId: NodeId.make("root"),
+ providerThreadId: null,
+ providerTurnId: null,
+ nativeItemRef: null,
+ role: "assistant",
+ text: "Starting the audit.",
+ ordinal: 1,
+ now: childCreatedAt,
+ });
+ if (artifacts.turnItem.type !== "assistant_message") throw new Error("Expected assistant item");
+ const failure = {
+ class: "usage_limit" as const,
+ message: "Claude API rate limit reached. Try again later.",
+ code: null,
+ retryable: true,