Skip to content

v0.3.12

Choose a tag to compare

@masmoo masmoo released this 04 Oct 23:18
· 3 commits to main since this release

CodeZaiku 0.3.12

The Claude Messages API as a drive, research before a coding task, a prepare step for slow checks, and the fixes that let
a long coding run on a local model finish or report. Measured on one brief with a 27B: zero passes in six runs without the research
pass, one pass in two with it; Claude finishes without it. A regression battery (a web API, a maintenance fix, an ML service) passed
on the release build.

Added

  • Research before the work. Before a multi-step coding task is planned, the model is asked for two or three questions a search
    engine can answer (which library or method fits, how the quantity the task turns on is defined or measured, what usually goes
    wrong). A short research pass answers them on the web and, where ResearchZosho is installed, in the library. The notes and their
    sources stay in the prompt from the plan onward. Settings: CODEZAIKU_RESEARCH_FIRST (auto by default, always, off),
    CODEZAIKU_RESEARCH_FIRST_TURNS (8).
  • Research when stuck. After three failing checks in a row, a second pass researches the symptom (the check's numbers and the
    method from each program's header) and adds a section to the notes. CODEZAIKU_RESEARCH_STUCK_TURNS (6); at most twice a run.
  • Prepare step for a check. The plan can name a prepare: command next to the check: a program that does the slow, deterministic
    part once (reading every input, extracting features) and stores the results for the check to read. CodeZaiku runs it before the
    check and again only when that program changes. A check that takes over five minutes and has no prepare step is offered one
    (python evaluate.py is offered python prepare.py); nothing runs until the model writes it.
  • Claude Messages API. drive = https://api.anthropic.com (or any /v1/messages endpoint) uses Claude's own API instead of the
    OpenAI-compatible endpoint. CODEZAIKU_REASONING_EFFORT sets Claude's effort. Tools, system prompt and conversation are cached at
    the API; the usage ← log line shows cache reads and writes. The log keeps a summary of the model's thinking. Context window and
    output limit come from the API's model listing; at most 200,000 tokens of the window are used unless CODEZAIKU_CTX is set.
    CODEZAIKU_TEMP=none and CODEZAIKU_TOOL_CHOICE=auto are not needed on this drive. codezaiku doctor shows the API's own
    error when a key or model name is refused.
  • CODEZAIKU_REASONING_EFFORT: reasoning effort for thinking models (low, medium, high, xhigh on Qwen3.8), sent per
    request, so a server set up for quick chat can think harder in a coding run.
  • CODEZAIKU_THINKING_BUDGET: maximum thinking tokens per reply, for servers that accept the limit (llama.cpp). Unset: no limit.
  • CODEZAIKU_DRIVE_CLASS: frontier or small, for when the model's name does not say (see Changed).
  • write_file accepts copy_from: the file's content is taken from a file already in the project.

Changed

  • Project environments. A run installs packages into a per-project environment under ~/.codezaiku/envs, not into the user's
    Python or global package folders: a Python venv that still sees system packages, plus npm, cargo, go and gem install folders
    pointed at the same place. Every command activates it first. CODEZAIKU_PROJECT_ENV=off disables it. Linux, macOS and WSL;
    native Windows unchanged.
  • When the research pass runs. auto (default): when the drive is not a frontier-class model and a search source answers (a Brave
    key, a SearXNG in the settings, or the ResearchZosho library). always: on every drive. off: never. On an existing codebase the
    model's QUESTIONS: none is honoured and the pass gets half the turns; a project built from nothing is always researched.
    Basis: Claude finished the test brief without research; of eight 27B runs, the one that passed had the pass, and a second run with
    it did not.
  • Frontier-class is decided by the model's family name, wherever it runs: claude-* (through any gateway), gpt-5*, gpt-4.1*,
    o3*, o4*, gemini-2.5-pro, gemini-3*, grok-4*, deepseek-v3*, deepseek-r1, kimi-k2*, qwen3-max*, glm-5*. A
    family's mini, nano, flash, lite, small, tiny, distill or haiku variant counts as small. The Claude API is frontier
    regardless of name. CODEZAIKU_DRIVE_CLASS overrides the list.
  • A run whose declared check passes ends at the first task_done. The older end-of-run steps (verify rounds, project tests, the
    changed-files note) no longer run after a passing check. The shell stays available after the pass; the files that passed are kept,
    and a later change that breaks the check is reverted.
  • Project tests at task_done run inside the project's environment. A run that is sent back is told the command and shown the end
    of its output.
  • Drives that refuse a forced tool call (Claude Opus 5.5, Fable 5.1, Sonnet 5.5) work: after the first refusal CodeZaiku stops
    forcing for the session (CODEZAIKU_TOOL_CHOICE=auto sets this up front). A text-only reply ends the turn: it is the chat reply,
    the run's report on the last turn, or otherwise answered with a request for the next action.
  • A shell command run with timeout N gets N seconds, up to CODEZAIKU_SHELL_HEAVY_TIMEOUT_SEC (20 minutes). Previously every
    command was stopped at five minutes.
  • Drive timeouts follow the server's measured speed: each call may wait as long as that speed needs, twice as long after a timeout,
    and never longer than CODEZAIKU_DRIVE_TIMEOUT_MAX (30 minutes by default). CODEZAIKU_DRIVE_TIMEOUT is the minimum.
  • A run that stops because the server failed repeatedly reports the reason (too slow, with the last wait and tokens per second; no
    answer; or the server's message) instead of "context overflow". Status failed, as before.

Fixed

Long coding runs on local models could use every turn and end with the work half done and nothing reported. The causes, each fixed:

  • Compaction summaries are checked (text, with progress and next steps). An unusable one is requested again; if the second is
    unusable too, CodeZaiku writes the summary from its own record. The request states the task, disables thinking, and asks for a
    bounded summary with progress and next steps first.
  • The files a task names are tracked. Each turn shows which exist and which do not; task_done with one missing is bounced once;
    the final summary names any that were never written. Files present at the start are excluded.
  • Write-only turns. In runs of 20 turns or more, when a named program is unwritten at the halfway point, or a named program or
    document at the start of the final stretch, write_file is the only tool offered for up to three turns. Files a program produces
    are excluded.
  • The last turn of a coding run offers only task_done; its summary is the run's report. Status incomplete, as before.
  • The end-game note asks for the named files and a report of where the work stands, whether or not every target was reached. It
    used to say "only when that final run is green".
  • Only the latest reply's thinking stays in the conversation; older thinking is dropped first once the conversation passes half
    the window.
  • The plan for a multi-step task is requested before the first turn in a call of its own, with no tools offered, and shown every
    turn.
  • The research passes CodeZaiku runs itself (before the task, when stuck) get web, literature and library tools only and run in an
    empty folder. Given the project's files, they read code instead of researching. codezaiku research keeps the project as before.
  • A research run that ends its last turn with a thin answer (a placeholder, or a pointer to a file that does not exist) gets one
    text-only turn, and that text is the answer. The same turn already existed for an answer that described a table instead of
    containing one.
  • Behind llama-swap, a model that is not loaded yet has no upstream /props, and a run starting then read a window of 8,192 until
    the model was loaded. CodeZaiku now sends one request of one token first, which loads the model, and reads the window after it.