ci: add typechecking, fail fast in CI, and patch typechecking errors (#63)

This commit is contained in:
Charles Packer
2025-11-04 11:50:07 -08:00
committed by GitHub
parent 42eb671bf4
commit cf73f3a11f
27 changed files with 183 additions and 69 deletions

View File

@@ -123,6 +123,9 @@ export function backfillBuffers(
if (toolCalls.length > 0 && toolCalls[0]?.tool_call_id) {
const toolCall = toolCalls[0];
const toolCallId = toolCall.tool_call_id;
// Skip if any required fields are missing
if (!toolCallId || !toolCall.name || !toolCall.arguments) break;
const exists = buffers.byId.has(lineId);
buffers.byId.set(lineId, {

View File

@@ -23,11 +23,13 @@ export function formatArgsDisplay(argsJson: string): {
if ("request_heartbeat" in clone) delete clone.request_heartbeat;
parsed = clone;
const keys = Object.keys(parsed);
const firstKey = keys[0];
if (
keys.length === 1 &&
["query", "path", "file_path", "command", "label"].includes(keys[0])
firstKey &&
["query", "path", "file_path", "command", "label"].includes(firstKey)
) {
const v = parsed[keys[0]];
const v = parsed[firstKey];
display = typeof v === "string" ? v : String(v);
} else {
display = Object.entries(parsed)

View File

@@ -191,7 +191,7 @@ export async function drainStreamWithResume(
// Use the resume result (should have proper stop_reason now)
result = resumeResult;
} catch (e) {
} catch (_e) {
// Resume failed - stick with the error stop_reason
// The original error result will be returned
}