Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2b6a00d
fix: scope codegraph batch complexity targets to file paths
carlos-alm Jul 5, 2026
b28051a
fix: exclude parameters and interface/type members from dead-role cla…
carlos-alm Jul 5, 2026
17fbcba
fix: credit import-type usages as exports consumers
carlos-alm Jul 5, 2026
26918bb
fix: prevent fn-impact/query crash when -f/--file is passed
carlos-alm Jul 5, 2026
be6432c
fix: correct exported-symbol detection for literal and object-literal…
carlos-alm Jul 5, 2026
4ead840
fix: exclude primitive type keywords from ast --kind string matching
carlos-alm Jul 5, 2026
f6326bf
fix: resolve call edges through renamed import specifiers
carlos-alm Jul 5, 2026
590f560
fix: couple file_hashes updates with edge regeneration in incremental…
carlos-alm Jul 5, 2026
d3ea4a4
fix: compare signature-change diffs using new-file line ranges
carlos-alm Jul 5, 2026
c306812
feat: add environment doctor check for stale native binary and missin…
carlos-alm Jul 5, 2026
8bb5893
fix: eliminate non-deterministic ordering in community detection
carlos-alm Jul 6, 2026
46037b1
fix: sync update-graph.sh hook extension allowlist with EXTENSIONS
carlos-alm Jul 6, 2026
6a84cf9
fix: recompute directory structure metrics for affected directories o…
carlos-alm Jul 6, 2026
8d936d1
refactor: register hardcoded execFileSync/execSync maxBuffer values i…
carlos-alm Jul 6, 2026
11c84be
fix: gate blast-radius check on newly introduced risk, not pre-existi…
carlos-alm Jul 6, 2026
963301a
fix: gate identifier-argument dynamic call edges on callback-acceptin…
carlos-alm Jul 6, 2026
3e8035d
fix: gate Array.from's callback arg by position, not just callee name
carlos-alm Jul 6, 2026
879635e
fix: scope reexportedSymbols to actually-named re-export specifiers
carlos-alm Jul 6, 2026
0fe9fc3
fix: stop CFG block/edge count from overriding AST-derived cyclomatic…
carlos-alm Jul 6, 2026
ccf3c19
fix: backfill edges.technique for incrementally-inserted calls edges
carlos-alm Jul 6, 2026
d5b1162
fix: wrap remote embedding JSON parse failure in EngineError
carlos-alm Jul 6, 2026
fe7b3b7
fix: resolve merge conflicts with main (docs check acknowledged)
carlos-alm Jul 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/domain/search/providers/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,16 @@ export async function embedRemote(
batchNumber,
);

const json = (await response.json()) as OpenAIEmbeddingResponse;
let json: OpenAIEmbeddingResponse;
try {
json = (await response.json()) as OpenAIEmbeddingResponse;
} catch (err: unknown) {
throw new EngineError(
`Remote embedding endpoint ${url} returned a response that could not be parsed as JSON: ` +
`${err instanceof Error ? err.message : String(err)}`,
{ cause: err instanceof Error ? err : undefined },
);
}
const mapped = mapRemoteEmbeddingResponse(json, batch, url, dim);
dim = mapped.dim;
results.push(...mapped.vectors);
Expand Down
10 changes: 10 additions & 0 deletions tests/search/embedding-remote-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ describe('embedRemote', () => {
);
});

it('throws EngineError instead of a raw SyntaxError when the response body is not valid JSON', async () => {
fetchMock.mockResolvedValueOnce(
new Response('<html><body>Bad Gateway</body></html>', { status: 200 }),
);
await expect(embedRemote(['a'], { baseUrl: 'http://x', model: 'm' })).rejects.toMatchObject({
name: 'EngineError',
message: expect.stringContaining('could not be parsed as JSON'),
});
});

it('throws EngineError when the response shape does not match the input length', async () => {
fetchMock.mockResolvedValueOnce(
new Response(JSON.stringify({ data: [{ embedding: [1], index: 0 }] }), { status: 200 }),
Expand Down
Loading