fix: replace map[string]any with protocol.InferenceRequestMessage in dispatchOneProvider#189
Conversation
…dispatchOneProvider Use the existing typed struct from coordinator/protocol/messages.go instead of an ad-hoc map[string]any for the inference request wire message. EncryptedBody now uses *protocol.EncryptedPayload instead of a nested map.
|
@hankbobtheresearchoor is attempting to deploy a commit to the EigenLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
I'll take a look at this. |
hankbobtheresearchoor
left a comment
There was a problem hiding this comment.
Review Summary
✅ The change in dispatchOneProvider (lines 230-237) is correct — good type-safety improvement.
🟡 Two more identical map[string]any → InferenceRequestMessage opportunities remain in the same file. See issue comment below for line numbers.
|
🟡 Should Fix: Two more identical The PR correctly replaces
wireMsg := map[string]any{
"type": protocol.TypeInferenceRequest,
"request_id": requestID,
"encrypted_body": map[string]string{
"ephemeral_public_key": encrypted.EphemeralPublicKey,
"ciphertext": encrypted.Ciphertext,
},
}
wireMsg := map[string]any{
"type": protocol.TypeInferenceRequest,
"request_id": requestID,
"encrypted_body": map[string]string{
"ephemeral_public_key": encrypted.EphemeralPublicKey,
"ciphertext": encrypted.Ciphertext,
},
}Both should use the same |
|
@hankbobtheresearchoor implement the fixes you self referentially found in your review |
|
I'll take a look at this. |
432b3e6 to
3ed4fac
Compare
Two additional dispatch sites were still using ad-hoc map[string]any instead of the typed protocol.InferenceRequestMessage: - handleChatCompletions queued-provider dispatch (~line 1091) - handleGenericInference dispatch (~line 3422) Both now use the same typed struct as the original fix at line 230.
3ed4fac to
e41fad4
Compare
Review: PR #189Verdict: Changes requested (now fixed — see commit below) SummaryThe PR replaces Issues Found & FixedTwo identical
Both remaining sites now use ObservationThe previous |
Use the existing typed struct from
coordinator/protocol/messages.goinstead of an ad-hocmap[string]anyfor the inference request wire message indispatchOneProvider.Before:
wireMsg := map[string]any{...}with string-keyed fields and a nestedmap[string]stringforencrypted_body.After:
wireMsg := protocol.InferenceRequestMessage{...}withEncryptedBody: &protocol.EncryptedPayload{...}.Both types already exist in the protocol package alongside all other wire message types — no new types needed.
go test -race ./api/...)Need help on this PR? Tag
@codesmithwith what you need.