Skip to content

typeagent/telemetry/aiclient: perf + typing#2241

Merged
robgruen merged 5 commits intomainfrom
dev/robgruen/TODO/infra
Apr 23, 2026
Merged

typeagent/telemetry/aiclient: perf + typing#2241
robgruen merged 5 commits intomainfrom
dev/robgruen/TODO/infra

Conversation

@robgruen
Copy link
Copy Markdown
Collaborator

  • HitTable.getTopK: skip sort for k<1, handle k>size
  • Parallelize embeddingFS.loadEntriesSubset via asyncArray.mapAsync
  • Exponential backoff on telemetry logger retry loops
  • JsonSchemaType alias replacing any in structured-output/function-calling schemas

Split from #2210.

robgruen and others added 4 commits April 22, 2026 14:09
…a and FunctionCallingJsonSchema

Introduces a named Record<string, unknown> type that documents the intent
(an opaque JSON Schema object for the OpenAI API) while being more
type-safe than raw any.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both CosmosDB and MongoDB sinks retried immediately on transient errors
(e.g. ENOTFOUND when offline). Now each retry waits an exponentially
increasing delay (1 s, 2 s, …) before the next attempt, reducing
unnecessary network hammering when connectivity is lost.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The function was loading entries sequentially with a for-loop while the
sibling loadEntries() already used asyncArray.mapAsync with the folder's
concurrency setting. Apply the same pattern to loadEntriesSubset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two improvements to the getTopK function:
- When k < 1 (return-all case), skip the O(n log n) sort entirely and
  return map values directly in O(n).
- Change `k === map.size` guard to `k >= map.size` so over-sized k
  values also short-circuit correctly without running the score-level loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@robgruen robgruen temporarily deployed to development-fork April 22, 2026 23:44 — with GitHub Actions Inactive
@robgruen robgruen temporarily deployed to development-fork April 22, 2026 23:44 — with GitHub Actions Inactive
@robgruen robgruen added this pull request to the merge queue Apr 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 23, 2026
@robgruen robgruen added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 67c110f Apr 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant