Skip to content

feat(gateway): zero-retention history mode for ControlPlaneGateway - #13

Merged
Goldokpa merged 1 commit into
mainfrom
feat/zero-retention-history
Sep 29, 2026
Merged

Goldokpa merged 1 commit into
mainfrom
feat/zero-retention-history

Conversation

@Goldokpa

Copy link
Copy Markdown
Contributor

What

A sixth constructor argument, history: "client" (or IDENTARK_HISTORY_MODE=client), keeps the conversation in the gateway and sends it in full each call with store_history: false. The control plane then never stores prompts or responses. The default stays "server".

  • Assistant tool calls are kept in OpenAI shape, so tool loops replay correctly.
  • In client mode, persistMessages is local only.
  • New getHistoryMode(), history and clearHistory().
  • The HistoryMode type is exported.

Also fixed

  • invokeLlmStream read event.content, but the control plane streams delta, so streamed text was empty. Both are now accepted.
  • An {"error": ...} SSE event now throws ControlPlaneError.

Release order

Requires the backend change: https://github.com/identArk/backend/pull/36. Deploy it before releasing this, for the same reason as the Python SDK: an older server would replay its stored history on top of the client's full conversation.

Mirrors identark/identark (Python SDK parity).

Tests

  • 7 new tests in tests/control-plane.test.ts.
  • vitest: 165/165 pass.
  • tsc --noEmit and eslint src --max-warnings 0 are clean.

🤖 Generated with Claude Code

A sixth constructor argument, history: "client" (or IDENTARK_HISTORY_MODE=client),
keeps the conversation in the gateway and sends it in full with
store_history=false, so the control plane stores no prompts or responses.
Assistant tool calls are kept in OpenAI shape so tool loops replay. Default
stays "server". Exports the HistoryMode type.

Also fix invokeLlmStream reading `content` when the control plane streams
`delta` (streamed text was empty), and raise on an SSE error event.

Mirrors the Python SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Gold Okpa <okpagold@gmail.com>
@Goldokpa
Goldokpa merged commit ae3af90 into main Sep 29, 2026
4 checks passed
Goldokpa added a commit that referenced this pull request Oct 9, 2026
A sixth constructor argument, history: "client" (or IDENTARK_HISTORY_MODE=client),
keeps the conversation in the gateway and sends it in full with
store_history=false, so the control plane stores no prompts or responses.
Assistant tool calls are kept in OpenAI shape so tool loops replay. Default
stays "server". Exports the HistoryMode type.

Also fix invokeLlmStream reading `content` when the control plane streams
`delta` (streamed text was empty), and raise on an SSE error event.

Mirrors the Python SDK.

Signed-off-by: Gold Okpa <okpagold@gmail.com>
@Goldokpa Goldokpa mentioned this pull request Oct 27, 2026
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.

1 participant