Skip to content

Commit 8ab9464

Browse files
committed
test(kiro): document the retry-wording test helpers
CodeRabbit's docstring-coverage pre-merge check counts functions this PR touches; the new test file's helpers had no doc comments.
1 parent e98ed2c commit 8ab9464

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎tests/providers/kiro/kiro-completion-retry-wording.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ const completionAnswer = [
5454
frame("metadataEvent", { stopReason: "TOOL_USE" }),
5555
...tail,
5656
];
57+
/** A Kiro event-stream response that replays the given frames in order. */
5758
function response(frames: Uint8Array[]): Response {
5859
return new Response(new ReadableStream<Uint8Array>({
60+
/** Enqueue every frame, then close the stream. */
5961
start(controller) {
6062
for (const value of frames) controller.enqueue(value);
6163
controller.close();
@@ -64,6 +66,11 @@ function response(frames: Uint8Array[]): Response {
6466
}
6567
afterEach(resetKiroThrottleStateForTests);
6668

69+
/**
70+
* Run one Claude Code-shaped turn through the adapter: the first send answers with `first`, the
71+
* bounded retry with `retry`. Returns the client events, the physical send ordinals, every request
72+
* body, and the retry's parsed `conversationState` when a retry was sent.
73+
*/
6774
async function run(first: Uint8Array[], retry: Uint8Array[]) {
6875
const adapter = createKiroAdapter(provider);
6976
const budget = createTranslatorBudget();
@@ -73,6 +80,7 @@ async function run(first: Uint8Array[], retry: Uint8Array[]) {
7380
try {
7481
const request = await adapter.buildRequest(structuredClone(parsed));
7582
const upstream = await adapter.fetchResponse!(request, {
83+
/** Record each request body and answer the first send and the retry with their frames. */
7684
executor: (async (_url, init) => {
7785
bodies.push(String(init?.body));
7886
return response(bodies.length === 1 ? first : retry);

0 commit comments

Comments
 (0)