devin: wrong wire fields in client metadata, tool call deltas, and usage stats
Is it a request payload issue? [x] No, it's another issue.
Describe the bug
Three field-level bugs in the Devin executor's Connect-RPC wire handling, verified against the upstream protobuf schema.
Client metadata sends a wrong
ide_nameand a field the client does not send.BuildDevinClientMetadataByteswrites field 1 (ide_name) as"devin-cli". The client name is"chisel", and the code already has it asDevinDefaultClientName;GetUserStatusininternal/auth/devin/user_status.gouses it. The function also emits field 28 (ide_type), which the client does not send.Tool call deltas decode field 4 as a varint index that does not exist.
In
ChatToolCall, field 4 isinvalid_json_str(string), field 5 isinvalid_json_err(string), and field 6 isis_custom_tool_call(bool). There is no index field. The decoder reads field 4 as a varintIndex, so the string payload never decodes,Indexstays 0 on every delta, and all tool calls collapse into slot 0.invalid_json_str, the raw argument text for custom tool calls, andis_custom_tool_callare dropped entirely.Usage field 4 is folded into prompt tokens.
ModelUsageStatsfield 4 iscache_write_tokens, not extra prompt tokens. The parser adds it intoPromptTokens, so reported input is inflated whenever the upstream writes cache. For example a real usage block{input_tokens: 3, cache_write_tokens: 14361}is reported asprompt_tokens = 14364.
CLI Type devin
Model Name swe-1-6 (any devin model)
LLM Client Any client routed through the devin provider.
Expected behavior
- metadata field 1 sends
chiseland field 28 is not emitted - tool call deltas decode
invalid_json_str/invalid_json_err/is_custom_tool_call, and fragments aggregate by call id cache_write_tokensis accounted separately fromPromptTokens
Source: router-for-me/CLIProxyAPI