Tags

Tags give the ability to mark specific points in history as being important
  • v0.8.2

    v0.8.2 — backfill logging on schema-mode path
    
    Patch release. v0.8.0 / v0.8.1 left four logging gaps:
    parse_json_response was silent, run_with_json_retry had no terminal
    summary, oai.chat_completions had no entry/success log, header parse
    helpers had no rejection warning.
    
    Backfilled:
      - adapters.base.parse_json_response: DEBUG per candidate,
        DEBUG on winner, INFO summary on all-failed, WARN if jsonschema
        lib missing.
      - shared.runner.run_with_json_retry: INFO on entry, DEBUG per
        attempt, INFO/WARN per retry, INFO terminal summary
        (outcome=success|exhausted|crashed, attempts, retries,
        total_usage).
      - oai.chat_completions: INFO entry (model, stream, msg count,
        flag presence), INFO on schema/non-schema success, header
        parsers WARN on rejected values (truncated ≤80 chars).
    
    Uses the existing project _JsonFormatter — DEBUG=1 → JSON with
    ts/level/logger/func/line/file/msg. No new dependency.
    
    No secrets / tokens / bodies / env dumps logged. All 151 existing
    tests pass. No behavior change — observability only.
    
    Migration: none — internal change.
  • v0.8.1

    v0.8.1 — agent crash 500, sum usage across retries, per-attempt array
    
    Three correctness fixes on v0.8.0's schema-mode path + a streaming
    RunSpec regression-test backfill.
    
    1. Agent crash returns 500, not 422.
       v0.8.0 lumped "validation exhausted" and "agent process crashed"
       into one 422. Client retry loops never terminated on real crashes.
       Now 422 means caller-side (your schema or prompt), 500 means
       server-side (agent exit code in detail).
    
    2. Usage summed across every retry attempt.
       Every retry is its own paid LLM call. v0.8.0 reported only the
       final attempt's tokens — under-counting the provider bill.
       _accumulate_usage now sums every numeric usage key (input/output/
       total/cache_creation_*/cache_read_*/etc.) across attempts. Result
       is written back to result.usage so downstream payloads see real
       billable cost.
    
    3. Per-attempt breakdown via response.attempts (/run) and
       aicodebox_attempts (OAI envelope vendor extension):
         [{"index": N, "usage": {...}, "exitCode": N, "parseError": "..."},
          ...]
       Callers can render "retry 2/3 cost X tokens" or bill per attempt.
    
    4. Backfilled regression test for the v0.7.0 streaming RunSpec
       plumbing that shipped without coverage.
    
    151 tests (137 from v0.8.0 + 14 new). README + CHANGELOG synced.
    
    Migration: none — strict improvement. Clients with specific 422
    handlers should narrow to "validation failed" and add 500 for
    "agent crashed".
  • v0.8.0

    v0.8.0 — schema validation on /openai/v1 + smart JSON extraction
    
    v0.7.0 plumbed x-aicodebox-json-schema through to RunSpec but the OAI
    route never validated. Schema-set callers got 200 OK on malformed JSON.
    
    /openai/v1/chat/completions now runs the same self-correction path
    /run uses when x-aicodebox-json-schema is set (up to 3 re-prompts on
    parse / validation failure):
    
      Success     → message.content = canonical re-serialized JSON
                    (no fences, no prose) regardless of LLM formatting.
      Exhaustion  → HTTP 422 with the validation error in detail.
      stream=true → HTTP 400 (schema validation needs the complete
                    response; no clean recovery from mid-stream parse
                    failure over SSE).
    
    parse_json_response is now tolerant of LLMs that wrap JSON in fences
    mid-prose: tries clean → edge-fences → each ``` block (LAST first) →
    balanced-brace {...}/[...] with string-literal + escape handling.
    With a schema, the loop prefers candidates that BOTH parse AND
    schema-validate. The retry budget is reserved for actual structural
    failures. /run benefits too (shared helper).
    
    Refactor: _retry_prompt + _run_json_with_retry moved from
    modes/api/server.py into shared/runner.py as _json_retry_prompt +
    run_with_json_retry. JSON_RETRY_MAX lives next to it.
    
    Tests: 22 new (15 extraction + 7 OAI schema flow). test_api_run_
    response patcher updated for the new call site.
    
    Docs: README's /v1/chat/completions bullet expanded to list all the
    x-aicodebox-* headers and the new 422 / 400 failure semantics —
    backfills the v0.7.0 doc gap.
    
    Migration: additive. v0.7.0 callers that silently accepted malformed
    JSON now get either canonical JSON or HTTP 422 — strict improvement.
  • v0.7.0

    v0.7.0 — expose remaining RunSpec knobs on /openai/v1/chat/completions
    
    Additive. /openai/v1/chat/completions now accepts six more headers that
    map one-to-one onto /run body fields, so OAI clients no longer have to
    drop down to /run for schema validation, session resumes, or
    tool-allowlist control:
    
      x-aicodebox-json-schema        JSON object — schema-validates the
                                     final assistant turn; flips the run to
                                     output_format=json-verbose so the
                                     adapter event stream is available
                                     end-to-end.
      x-aicodebox-resume             string — adapter session id to resume.
      x-aicodebox-extra-args         JSON array OR comma-separated string.
      x-aicodebox-timeout-seconds    int — per-run timeout.
      x-aicodebox-tools-allowlist    JSON array OR comma-separated string.
      x-aicodebox-no-tools           1/true/yes — disables tool surface.
    
    Malformed header values surface as 400 with the offending header name
    in the detail. Body-level tools / tool_choice / response_format=
    json_object remain 400 — those are distinct OAI-protocol concerns from
    the new tools_allowlist / no_tools / json_schema RunSpec knobs.
    
    The streaming path is wired identically — same six knobs flow into the
    streamed RunSpec.
    
    No breaking changes. Existing OAI requests behave the same. Also ships
    the FUNDING.yml that was committed but untagged on top of v0.6.0, and a
    backfilled CHANGELOG.md covering every release from v0.1.0.
  • v0.6.0

    v0.6.0 — kill the verbose flag, jsonSchema is the only dial
    
    Breaking change to /run. v0.5.0's two-flag matrix (verbose + jsonSchema)
    collapses to one — jsonSchema decides everything:
    
      no jsonSchema → {runId, workspace, exitCode, text}                 (lean)
      jsonSchema    → {runId, workspace, exitCode, text, json,           (full)
                       events, sessionId, usage}
                      + {parseError, jsonRetries} (replaces json) on
                        schema-validation failure after 3 retries
                        (everything else still surfaces for debugging)
    
    Schema mode is always-verbose. Want events without strict validation?
    Pass "jsonSchema": {"type": "object"} — permissive, just forces JSON
    output.
    
    The verbose field is removed from the request model. Pydantic silently
    ignores stale verbose=true callers (extra=ignore) — they get the lean
    text response without a 422.
    
    Migration:
      - drop verbose=true; if you wanted events/sessionId/usage, set
        jsonSchema (use {"type":"object"} for permissive)
      - schema-set callers now also receive text + events + sessionId +
        usage alongside json
      - SDK regen recommended
  • v0.5.0

    v0.5.0 — replace outputFormat dial with verbose flag + rename parsed→json
    
    Breaking change to /run. v0.4.0's outputFormat enum conflated LLM
    output style with response richness; v0.5.0 splits them into two
    orthogonal request flags:
    
      jsonSchema (dict|null) → agent runs in JSON mode, response carries
                               json field. 3-retry self-correction on
                               parse/schema failure.
      verbose    (bool)      → response includes events + sessionId + usage
                               alongside text.
    
    jsonSchema + verbose=true composes — verbose surface plus json (or
    parseError + jsonRetries on failure).
    
    Field rename: parsed → json. SDK regen recommended.
  • v0.4.0

    v0.4.0 — /run restructure: outputFormat dial + JSON retry + opt-in raw
    
    Breaking change. /run no longer ships raw_stdout / raw_stderr by default
    and the payload shape is now strictly determined by ``outputFormat``:
    
      text          → {..., text}
      json          → {..., parsed} on success;
                      {..., text, parseError, jsonRetries} on exhaustion
      json-verbose  → {..., events}
    
    Always-when-populated: sessionId, usage. Opt-in via includeRaw=true:
    stdout + stderr. Auto-included on exitCode != 0: stderr.
    
    JSON mode now self-corrects: failed JSON decode / schema validation
    triggers up to 3 retries where the agent is re-prompted with its prior
    bad output and the specific error. ``jsonRetries`` reports the count.
    
    AgentAdapter gains ``parse_events(stdout, req)`` — invoked only in
    json-verbose mode. Default returns []; adapters emitting structured
    streams override to JSON-decode each line.
    
    Migration: callers reading result.stdout / result.stderr must either
    opt into includeRaw or migrate to result.text / result.parsed /
    result.events. JSON callers who read the raw text on success must move
    to ``parsed``. SDK regen recommended.
  • v0.3.0

    v0.3.0 — real OAI streaming
    
    Replaces the previous single-chunk fake-stream on
    /openai/v1/chat/completions with stream=true. New components:
    
      - StreamEvent + AgentAdapter.parse_stream_event — typed per-line
        adapter hook for structured streaming.
      - shared.runner.run_stream — async generator over the agent's
        stdout. Default behaviour: one text delta per line; adapters
        override parse_stream_event to decode their native event stream
        (json-verbose, etc.).
      - oai.py _stream_response — emits one chat.completion.chunk per
        delta event, real-time. Subprocess killed on client disconnect.
    
    Bonus: oai.py reads usage token counts through alias-aware helper
    (input_tokens / inputTokens / input — same for output) so adapters
    don't need to dual-write the key shape.
    
    No breaking changes — adapters without a custom parse_stream_event
    get the default line-per-delta behaviour automatically, which is
    itself a strict improvement over the old buffered single-chunk path.
  • v0.2.1

    v0.2.1 — require explicit model list for API mode
    
    Follow-up to v0.2.0. The previous release's /v1/models endpoint
    silently fell back to [adapter.name] (e.g. ["pi"]) when no model
    list was configured — that's a harness binary name, not a valid model
    id. OAI clients calling /v1/chat/completions with model="pi" got
    nonsense.
    
    This release:
    
      - API mode refuses to boot if neither AICODEBOX_AVAILABLE_MODELS
        nor adapter.available_models declares anything. Loud failure
        with a clear "set this env var" message.
      - /v1/models reflects the configured list verbatim — no
        adapter-name fallback.
      - Telegram /model and /effort pickers degrade gracefully on empty
        list (reply with a "set this env var" message; bot keeps running).
      - Cron / MCP / passthrough are unaffected — they forward the
        caller's model string to the harness, which errors directly on
        bad model ids.
      - shared/choices.py is the single source of truth for the list.
    
    Breaking change vs v0.2.0: API mode containers that didn't set
    AICODEBOX_AVAILABLE_MODELS used to boot and serve /v1/models with the
    bogus fallback. Now they refuse to start. Set the env var
    (comma-separated) with the model ids your provider actually serves.
  • v0.2.0

    v0.2.0 — env var rename + standalone MCP mode
    
    Every mode flag and knob follows <MODE>_MODE / <MODE>_MODE_<KNOB> now.
    MCP is independent of API/Telegram/Cron and can coexist (sidecar in
    non-API modes, /mcp mount inside API). Separate bearer token per
    surface (API_MODE_TOKEN vs MCP_MODE_TOKEN), no fallback between them.
    
    Breaking change: every consumer setting AICODEBOX_MODE_API,
    AICODEBOX_TELEGRAM_BOT_TOKEN, AICODEBOX_MODE_CRON_FILE, etc., needs to
    rename to the new shape. No backwards-compat shim — clean break.
  • v0.1.3

    docs: correct mode combination claims
  • v0.1.2

    fix arm64 build and uv system install
  • v0.1.1

    switch to uv, pin image digests