fix(mitm): align hookBufferUpdate caller type with sourceModel runtime (R4 #4)

The local type annotation for `recordRequestStart` in `loadAgentBridgeHook`
omitted `sourceModel`, but the call site at line 217-222 passes
`sourceModel: this.extractSourceModel(body)` — which works at runtime
(JavaScript ignores extra properties) but a future strict-mode caller relying
on the narrower local type would silently drop the field.

Add `sourceModel?: string | null` to the local recordRequestStart type to
match the actual `agentBridgeHook.recordRequestStart` shape.
This commit is contained in:
diegosouzapw
2026-05-28 21:06:47 -03:00
parent 51740a7279
commit b34e2cc4e3

View File

@@ -53,6 +53,7 @@ async function loadAgentBridgeHook(): Promise<{
body: Buffer;
agentId: AgentId;
mappedModel: string;
sourceModel?: string | null;
}) => Promise<InterceptedRequest>;
recordRequestComplete?: (
intercepted: InterceptedRequest,