Summary
The proxy stores a mode (inject or smart) in ~/.config/ergosum/mode.json and reads it on every request, but fetchPrepare never sends it in the /api/cli/proxy/prepare payload. The server gets messages, window_tokens, last_user_text, session_id — nothing else.
Where
src/proxy.ts:420-425
const result = await ergoRawPost(baseUrl, '/api/cli/proxy/prepare', token, {
messages,
window_tokens: windowTokens,
last_user_text: queryContext.slice(0, 800),
session_id: PROXY_SESSION_ID,
}, 800);
Meanwhile the mode UI exists — ergosum-proxy --mode inject|smart, status output at src/proxy.ts:682-689 — so users can flip modes and nothing observable changes server-side.
Impact
Either:
- The server already decides mode on its own (in which case the client-side mode config is vestigial and should be removed), or
- The server is supposed to honour the client's mode but can't (in which case
/prepare is silently returning the wrong shape of context).
Both are confusing; both deserve a decision.
Proposed fix
Pick one path and apply it consistently:
- Wire it up: add
mode: cfg.mode to the fetchPrepare payload and have the server branch on it.
- Remove it: delete the mode config / CLI surface entirely and let the server make the call.
Either is fine — the status quo (config exists, has no effect) is the bad option.
Summary
The proxy stores a mode (
injectorsmart) in~/.config/ergosum/mode.jsonand reads it on every request, butfetchPreparenever sends it in the/api/cli/proxy/preparepayload. The server getsmessages,window_tokens,last_user_text,session_id— nothing else.Where
src/proxy.ts:420-425Meanwhile the mode UI exists —
ergosum-proxy --mode inject|smart, status output atsrc/proxy.ts:682-689— so users can flip modes and nothing observable changes server-side.Impact
Either:
/prepareis silently returning the wrong shape of context).Both are confusing; both deserve a decision.
Proposed fix
Pick one path and apply it consistently:
mode: cfg.modeto thefetchPreparepayload and have the server branch on it.Either is fine — the status quo (config exists, has no effect) is the bad option.