Skip to content

Releases: sodre90/agy-proxy

v0.1.11 — fix two rough edges in the LaTeX filter

Choose a tag to compare

@sodre90 sodre90 released this 17 Sep 05:27

Follow-ups to v0.1.10, both worth taking before using it:

  • Inside a fenced code block the filter held every partial line waiting for its newline, so code painted a line at a time instead of as it streamed. Only a line that could still become the closing fence waits now.
  • The non-streaming path ("stream": false) discarded the events closeAll returns, which since v0.1.10 can carry the filter's flushed tail — a response ending on unclosed math lost that text.

v0.1.10 — LaTeX is rewritten, not just discouraged

Choose a tag to compare

@sodre90 sodre90 released this 17 Sep 05:23

The system-prompt note added in v0.1.6/v0.1.9 asks the model for plain-text math. A prompt is probabilistic, so the proxy now also filters the response stream: $K = 4$ and $\frac{a}{b} \times \text{-}k$ reaches the client as K = 4 and a/b × -k.

  • Holds back only what it cannot decide yet (a trailing $, a half-typed command, an unclosed span), so the result does not depend on where the stream is chunked.
  • Text containing no $, backslash or backtick is returned whole and never buffered — ordinary output is not delayed.
  • Code fences, inline code, money ($5) and shell variables ($HOME/$PATH, ${JAVA_HOME}) are left alone. Known gap: two lowercase shell variables on one un-fenced line ($foo/$bar).
  • AGY_PROXY_KEEP_LATEX=1 now disables the filter as well as the note.

v0.1.9 — stronger plain-text math instruction

Choose a tag to compare

@sodre90 sodre90 released this 17 Sep 04:35

Gemini still emitted $K$ and \text{-} through the previous note on gemini-3.7-flash-high (leaked in 1 of 2 trials on a MoE-caching prompt). The instruction now names the forbidden constructs and shows the expected Unicode form; 0 leaks in 5 trials on 3.7 and 2 of 2 clean on 3.8.

This is a prompt-level mitigation, not a guarantee. AGY_PROXY_KEEP_LATEX=1 still disables it.

v0.1.8 — fix tuple-form array schemas

Choose a tag to compare

@sodre90 sodre90 released this 17 Sep 04:25

Fixes 400 ... .items: missing field on tools whose parameters use tuple-form arrays.

The upstream proto requires items on every ARRAY. The normalizer only accepted items as an object, so tuple schemas — prefixItems, or items given as a list — were dropped and the array arrived bare, failing the entire request (every tool in it). Affected real tools including query.where and batch.

Tuple schemas now adopt their first entry as the element type, and an array whose element type cannot be recovered gets an unconstrained {} — verified accepted upstream, and the model still produces correct nested tuples such as [["status","eq","active"]].

Assets: macOS darwin-arm64/darwin-amd64, Linux linux-arm64/linux-amd64 (static).

v0.1.7 — fix const/anyOf tool schemas

Choose a tag to compare

@sodre90 sodre90 released this 17 Sep 04:21

Fixes 400 Invalid JSON payload received. Unknown name "const" ... Cannot find field when a tool schema uses anyOf/oneOf/allOf.

The schema pruner is an allow list, but allOf/anyOf/oneOf branches were merged in raw, bypassing it — so a property like {"anyOf": [{"const": "moe"}]} sent const upstream and failed the entire request, tools and all. A lowercase type leaked by the same route. Branches now pass through the normalizer, so const becomes a single-value enum and types are uppercased at any depth.

Adds the first tests to the repo, covering both leaks and the system-prompt sanitizer.

Also in 0.1.6/0.1.7: plain-text math instead of LaTeX, and README notes on the 1M context window (CLAUDE_CODE_MAX_CONTEXT_TOKENS).

Assets: macOS darwin-arm64/darwin-amd64, Linux linux-arm64/linux-amd64 (static).

v0.1.6 — plain-text math

Choose a tag to compare

@sodre90 sodre90 released this 16 Sep 19:44

Mathematics now arrives as readable plain text instead of raw LaTeX.

Gemini is trained for chat UIs that render KaTeX, so it answers with TeX markup — $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ — which a terminal prints literally. The proxy now appends one line to the system prompt asking for Unicode math (x = (-b ± √(b² - 4ac)) / (2a)), verified to produce zero TeX markers.

Set AGY_PROXY_KEEP_LATEX=1 to restore the previous behaviour for a client that renders TeX.

Assets: macOS darwin-arm64/darwin-amd64, Linux linux-arm64/linux-amd64 (static).

v0.1.5 — quota endpoint

Choose a tag to compare

@sodre90 sodre90 released this 16 Sep 12:58

Adds GET /usage: the Google subscription's own quota, for status lines and scripts.

Relays v1internal:retrieveUserQuotaSummary and caches it for a minute, so it can be polled on every status-line render. Returns 5-hour and weekly buckets with remainingFraction (what is left, not used) and resetTime, for both the Gemini group and the Claude/GPT-OSS group the same subscription covers.

Assets: macOS darwin-arm64/darwin-amd64, Linux linux-arm64/linux-amd64 (static).

v0.1.4 — persist thought signatures across restarts

Choose a tag to compare

@sodre90 sodre90 released this 16 Sep 11:20

Restarting the proxy no longer degrades running Claude Code sessions.

Tool-call thoughtSignature values are now persisted to ~/.config/agy-proxy/signatures.jsonl (0600, append-only, compacted at startup, last 8192 calls) and replayed on the next start, so existing tool history keeps its structured, signed form across a restart. v0.1.3 added a plain-text fallback for unsigned exchanges; that now only applies to signatures that are genuinely unknown (predating the log, or evicted).

Also: signature-store access is mutex-guarded — concurrent tool calls previously wrote the map unsynchronized. Verified under go build -race with parallel tool-calling requests.

Assets: macOS darwin-arm64/darwin-amd64, Linux linux-arm64/linux-amd64 (static).

v0.1.3 — fix missing thought_signature 400

Choose a tag to compare

@sodre90 sodre90 released this 16 Sep 11:10

Fixes 400 Function call is missing a thought_signature in functionCall parts mid-session.

When a request ends on a tool result — the model continuing from its own call — upstream requires every functionCall in the history to carry a thoughtSignature, and refuses a fabricated one as "Corrupted thought signature". The proxy keeps those signatures in memory, so restarting it mid-session broke every subsequent turn of a running conversation.

Tool exchanges whose signature is unknown are now replayed as plain text parts ([called tool Bash with {...}] / [tool Bash result: ...]), which upstream accepts. Calls made after the restart still use the structured, signed path. Signatures were verified portable across models, so switching model mid-session is safe.

Assets: macOS darwin-arm64/darwin-amd64, Linux linux-arm64/linux-amd64 (static).

v0.1.2 — fix gemini-3.1-pro-high

Choose a tag to compare

@sodre90 sodre90 released this 16 Sep 10:53

Routes gemini-3.1-pro-high to gemini-pro-agent.

The catalog advertises gemini-3.1-pro-high, but the generation endpoint rejects it with a bare 400 INVALID_ARGUMENT whatever the envelope (bisected: thinkingConfig removed, requestType varied, minimal request — all 400). gemini-pro-agent carries the same catalog display name ("Gemini 3.1 Pro (High)"), answers normally, and is now substituted for it. gemini-3.1-pro-low works as listed.

Includes the 2.1.273 x-anthropic-billing-header 429 fix from v0.1.1.

Assets: macOS darwin-arm64/darwin-amd64, Linux linux-arm64/linux-amd64 (static). Unsigned on macOS — xattr -d com.apple.quarantine ./agy-proxy if Gatekeeper objects.