Skip to content

Return real E2EE tool calls to agents like Hermes - #3

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/e2ee-tool-calls-830a
Oct 27, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/e2ee-tool-calls-830a

Conversation

@gsmachado

Copy link
Copy Markdown
Member

Summary

Hermes could not use tools on E2EE models. Venice already emitted the call: a short preamble in delta.content, then delta.tool_calls, then finish_reason: "tool_calls". This proxy kept only the text and closed the stream with finish_reason: "stop". Hermes stored that cut-off message and never ran a tool. The follow-up was then rejected, because an assistant tool-call message is content: null and ChatMessageDto required content. toPlainMessages also stripped tool_calls, tool_call_id, and name before encryption.

After this change:

  • Streaming responses emit delta.tool_calls chunks in upstream order. The final chunk uses the real finish reason (tool_calls, stop, or length).
  • Non-streaming responses assemble those deltas by index onto message.tool_calls. A tool-only turn has content: null.
  • Follow-up messages may set content: null and include tool_calls, tool_call_id, and name.
  • Tool-result bodies are passed through to encrypt, so they stay ciphertext. Tool names, JSON schemas, call ids, and arguments stay plaintext. That is the Venice E2EE rule: the enclave chat template reads those fields as JSON.

Library pin

@axlabs/venice-e2ee is pinned to the merged library commit 7b4e6528f7f870402224bc887de06f0952f7f575 (AxLabs/venice-e2ee#1) via git+https, not the registry. 0.2.0 still drops tool calls, and 0.3.0 is not on npm. This environment has no npm credentials, and the library CI workflow does not publish.

Follow-up, from a clean library main:

npm run release -- minor   # 0.2.0 -> 0.3.0, publishes @axlabs/venice-e2ee

Then in this repo, replace the git pin with "@axlabs/venice-e2ee": "^0.3.0", refresh the lockfile, and release the proxy (npm run release -- patch). decryptStream now yields structured events instead of strings, so do not point this proxy back at 0.2.0.

Tests

  • npm test — 34 passed
  • npm run lint — clean
  • npm run build — nest build succeeded
  • npm ci — installs the pinned library commit over HTTPS
Open in Web Open in Cursor 

The proxy kept only decrypted text and always finished with stop, then
rejected the follow-up because an assistant tool call uses content null.
Stream tool_calls deltas in order, assemble them when the client does not
stream, and send tool-result bodies to encrypt while leaving call metadata
in the clear.

The library pin is the unpublished commit 7b4e652 until 0.3.0 is on npm.

Co-authored-by: guil <guil@axlabs.com>
@cursor
cursor Bot merged commit 069a6e8 into main Oct 27, 2026
1 of 2 checks passed
@cursor
cursor Bot deleted the cursor/e2ee-tool-calls-830a branch October 27, 2026 23:51
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.

2 participants