@chatpanel/gateway 0.6.75 → 0.6.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/server.js +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/gateway",
3
- "version": "0.6.75",
3
+ "version": "0.6.76",
4
4
  "description": "Local privacy gateway \u2014 redacts PII out of OpenAI/Anthropic API traffic before it reaches a model, then restores it in the reply. Point opencode, codex, aider, Claude Code, etc. at it.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,7 +27,7 @@
27
27
  "node": ">=18"
28
28
  },
29
29
  "dependencies": {
30
- "@chatpanel/pii": "^0.7.1",
30
+ "@chatpanel/pii": "^0.7.2",
31
31
  "@huggingface/transformers": "^4.2.0",
32
32
  "onnxruntime-web": "1.26.0-dev.20260416-b7804b056c",
33
33
  "phonemizer": "^1.2.1"
package/src/server.js CHANGED
@@ -56,7 +56,7 @@ import * as openai from './openai.js';
56
56
  import * as responses from './responses.js';
57
57
  import * as anthropic from './anthropic.js';
58
58
 
59
- export const VERSION = '0.6.75';
59
+ export const VERSION = '0.6.76';
60
60
 
61
61
  // WARM search tier — SQLite + FTS5 record store (falls back to an encrypted-JSON
62
62
  // store if SQLite can't load), fed by the extension's ingest sync + backup-ingest.
@@ -1808,7 +1808,16 @@ export function createGateway(cfg = loadConfig()) {
1808
1808
  // AFTER redaction so the note isn't itself redacted. Covers BOTH the API
1809
1809
  // forward and the relay (which reads system from this same body).
1810
1810
  if (!redactionOff && Array.isArray(body.tools) && body.tools.length && typeof r.adapter.injectSystemNote === 'function') {
1811
- r.adapter.injectSystemNote(body, placeholderToolNote({ toolData: cfg.tools?.toolData }));
1811
+ // A relayed CLI agent brings tools of its own that run PAST this proxy and get the
1812
+ // placeholder literally; an API model has only the tools in this request. The note
1813
+ // has to say which is which, so the destination is looked up here — the same
1814
+ // resolution as below, on the same hint, just earlier. No destination means the
1815
+ // legacy bridge path, which is an agent.
1816
+ const early = resolveDestination(body?.model, cfg, r.kind, {
1817
+ destination: String(req.headers['x-chatpanel-destination'] || body?.chatpanel?.destination || '').trim(),
1818
+ });
1819
+ const ownTools = !(early && early.type === 'api');
1820
+ r.adapter.injectSystemNote(body, placeholderToolNote({ toolData: cfg.tools?.toolData, ownTools }));
1812
1821
  }
1813
1822
  outBody = Buffer.from(JSON.stringify(body), 'utf8');
1814
1823
  }