Skip to content

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 23 May 11:11
· 105 commits to master since this release

[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 — /version returns "Unknown" — /version (and /v) now print the SmallCode version, package description, and Node/platform info. Sourced from package.json so the value can never drift. Added to the /help listing 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 structured tool_calls field. Wired into bin/smallcode.js, src/api/index.js, and src/session/parallel_executor.js so 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_fetch URL reach cloud metadata under LLM_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 through hostVariants() and hit isAlwaysBlocked like the dotted-quad form already did.
    • _fetchWithBrowser (Playwright path) now intercepts every per-hop request via page.route and re-asserts the SSRF guard, so a 302 to a metadata IP is rejected before connect — matching the existing redirect: 'manual' defence in _fetchSimple.
    • The .ts and .js ssrf_guard sources are now in sync, so a future node build.js won't regress the fix. Origin-equality matching replaces the prior endpoint.startsWith(allow) (prefix-spoof angle).
    • 14 new regression tests in test/ssrf_guard.test.js.

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 /version cases (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