Skip to content

Commit 90b47b0

Browse files
committed
docs(task): JSDoc for diff-touched functions flagged by CodeRabbit
DTE series 2/5 — addresses the CodeRabbit docstring-coverage warning on #1338 (33.33% < 80% across the functions touched by the diff): - AnthropicHandler.createMessage: documents the shared effective-effort resolution and the adaptive output_config.effort envelope (in-range only). - Task.dispose: documents centralized teardown incl. the transient task-local override reset. - Task.updateApiConfiguration: documents the override-preservation behavior (re-captured restore value + re-applied override on the new in-memory copy). Comment-only change: 30/30 patch lines and 10/10 branches unchanged; 317/317 tests and tsc --noEmit re-verified green.
1 parent 14d1f35 commit 90b47b0

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎src/api/providers/anthropic.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
6262
})
6363
}
6464

65+
/**
66+
* Creates a streaming Anthropic message for the current model.
67+
*
68+
* Resolves the effective thinking effort for this request through the shared
69+
* `resolveEffectiveReasoningEffort` point (per-request override → settings →
70+
* model default). For adaptive-thinking models, when the resolved effort is one
71+
* of `ADAPTIVE_OUTPUT_CONFIG_EFFORTS` (low|medium|high|xhigh|max), the request
72+
* carries `output_config: { effort }` (DTE series 2/5); out-of-range or unset
73+
* efforts omit it so the API default applies.
74+
*
75+
* @param systemPrompt - The system prompt for the request.
76+
* @param messages - The message history to send.
77+
* @param metadata - Per-request metadata (carries the task-local effort override).
78+
* @returns An async iterator of parsed Anthropic stream events.
79+
*/
6580
async *createMessage(
6681
systemPrompt: string,
6782
messages: Anthropic.Messages.MessageParam[],

‎src/core/task/Task.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,12 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
15211521
* Updates the API configuration and rebuilds the API handler.
15221522
* There is no tool-protocol switching or tool parser swapping.
15231523
*
1524+
* DTE series 2/5: when a task-local thinking effort override is active
1525+
* (`setRuntimeThinkingEffort`), the incoming configuration's `reasoningEffort`
1526+
* becomes the new restore value and the override is re-applied on top of the
1527+
* fresh in-memory copy — clearing the override later restores the NEW profile's
1528+
* value, not a stale one.
1529+
*
15241530
* @param newApiConfiguration - The new API configuration to use
15251531
*/
15261532
public updateApiConfiguration(newApiConfiguration: ProviderSettings): void {
@@ -2371,6 +2377,13 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
23712377
}
23722378
}
23732379

2380+
/**
2381+
* Centralized task teardown: releases task resources and resets transient
2382+
* task-local state.
2383+
*
2384+
* DTE series 2/5: also clears the task-local thinking effort override (the
2385+
* `setRuntimeThinkingEffort` state) — the override never outlives the task.
2386+
*/
23742387
public dispose(): void {
23752388
console.log(`[Task#dispose] disposing task ${this.taskId}.${this.instanceId}`)
23762389

0 commit comments

Comments
 (0)