Repository navigation
v1.1.0
[1.1.0] - 2026-05-23
feat: tool-call recovery + /version command + SSRF guard hardening
Two issues closed (#36, #40), one external security PR merged (#39).
-
Issue #40 —
/versionreturns "Unknown" —/version(and/v) now print the SmallCode version, package description, and Node/platform info. Sourced frompackage.jsonso the value can never drift. Added to the/helplisting too. -
Issue #36 — qwen2.5-coder:14b spills tool JSON into chat — added a defensive tool-call extractor (
src/tools/tool_call_extractor.js) that recovers tool invocations the model emitted as text instead of as a structuredtool_callsfield. Wired intobin/smallcode.js,src/api/index.js, andsrc/session/parallel_executor.jsso all three entry points benefit. Recognises four shapes:<tool_call>{...}</tool_call>(Hermes / qwen native template)```json ... ```and```tool_call ... ```fences- Bare leading JSON object/array
{ "function": { "name", "arguments" } }and{ "tool", "args" }forms- Tolerates trailing commas, which qwen sometimes emits.
Conservative by design — calls referencing unknown tool names are left in the chat content rather than executed.
-
PR #39 — SSRF guard bypasses (security) — closes two adjacent gaps in the SSRF guard that let an LLM-controlled
web_fetchURL reach cloud metadata underLLM_ALLOW_PUBLIC_ENDPOINTS=1. Thanks to @aaronjmars for the report and patch.- IPv4-mapped IPv6 aliases (
[::ffff:169.254.169.254],[::ffff:a9fe:a9fe],[0:0:0:0:0:ffff:169.254.169.254]) now route throughhostVariants()and hitisAlwaysBlockedlike the dotted-quad form already did. _fetchWithBrowser(Playwright path) now intercepts every per-hop request viapage.routeand re-asserts the SSRF guard, so a 302 to a metadata IP is rejected before connect — matching the existingredirect: 'manual'defence in_fetchSimple.- The
.tsand.jsssrf_guard sources are now in sync, so a futurenode build.jswon't regress the fix. Origin-equality matching replaces the priorendpoint.startsWith(allow)(prefix-spoof angle). - 14 new regression tests in
test/ssrf_guard.test.js.
- IPv4-mapped IPv6 aliases (
Verification
- 10/10 tool-call extractor cases (qwen tag, fenced JSON, bare JSON, OpenAI-shape, multi-call, unknown-tool rejection, trailing commas, prose passthrough, already-structured passthrough,
{tool, args}variant) - 3/3
/versioncases (command, alias, unknown-passthrough) - 14/14 SSRF guard cases including all five metadata aliases
- Existing 11/11 TUI unit tests still pass
- CI green on Linux, macOS, Windows
Install
- npm:
npm install -g smallcode@1.1.0 - Pre-built tarballs: see assets below