Skip to content

v0.42.0

Choose a tag to compare

@jale-dbox jale-dbox released this 25 Nov 12:38
· 4 commits to main since this release
v0.42.0
e3a2abd

Added

  • GET /.well-known/decisionbox — unauthenticated deployment discovery. A client pointed at a deployment URL needs to know three things before it has any credentials: which API contract the server speaks, which capabilities it has, and how to authenticate. There was no way to ask. The DecisionBox Chat mobile client's first screen is "type your deployment URL", which cannot work without it.

    The endpoint is mounted ahead of the auth chain, on an exact-path sub-mux so it owns the path for every method — a non-GET answers 405, not the 401 that falling through to the auth chain would produce, which would tell a client it needs a login for the one endpoint that exists to be read without one. Its body is deliberately not wrapped in the {"data": ...} envelope: a client reads it before it knows any of the platform's conventions.

    auth.type is always explicit (none or oidc), never absent. A client that had to infer "no authentication" from a missing field would downgrade a misconfigured OIDC deployment to anonymous access and then fail every subsequent call with an unexplained 401. The new libs/go-common/wellknown registry is how a build that enables authentication fills in the issuer, mobile client id, scopes and audience, and its stated invariant is that this happens in the same init() that installs the auth provider — split across two, the advertised mode and the enforced mode can diverge.

    The advertised features list carries only capabilities the server mounts unconditionally. Plan- or licence-gated features are reported after login by GET /api/v1/capabilities, which knows the entitlement, and whether a question runs as an asynchronous Ask turn is discovered per response, because it depends on the project and the caller's role rather than on the deployment.

  • PATCH /api/v1/projects/{id}/ask/sessions/{sessionId} — rename a conversation. Advertised as the ask_session_rename discovery feature so a client can hide the control against an older deployment.

    Requires viewer, matching delete: a user who can hold a conversation can name it, and the repository's existing (project, owner, id) key is what stops a viewer touching anyone else's. Another user's session answers 404, not 403 — the wrong tier is a 403, the wrong scope is a 404, and somebody else's conversation is scope. AskSessionRepo.UpdateTitle is owner-scoped like every other method on that interface rather than taking a bare session id; the single unscoped write would have been the one nobody remembers to scope.

    The 200-character cap is counted in runes, so a Turkish or Japanese title gets the same allowance as an English one and truncation never splits a character into invalid UTF-8. The response echoes the stored title rather than the submitted one, so a truncated title renders as truncated instead of drifting from the document until the next reload.

  • GET /api/v1/projects/{id}/schema-cache/tables?source=warehouse — the warehouse's catalogue, not the indexed subset. The endpoint has always answered from the project's schema cache, falling back to a live names-only enumeration only while that cache is completely empty. That is the right default for a caller asking what is indexed, and exactly wrong for one asking what could be: a registered ListTables filter narrows what gets indexed, so once such a project has been indexed the two sets are identical and the endpoint can only ever report the tables already selected. A caller built on it can narrow a selection and never widen it.

    source=warehouse always runs the live enumeration, through the same per-datasource TTL cache and singleflight that already bound the fallback — so a picker that re-fetches on every page open and every datasource switch still shares one agent run per TTL window rather than spawning one per poll. source=index is the default spelled out; any other value is a 400, because a caller that asked for the warehouse and quietly received the index has no way to tell.

    It bypasses the index, not deployment-level filtering: a registered ListTables filter runs on the live listing too, so a plugin that filters both paths returns its restricted set either way. Worth stating, because the parameter's whole justification is such a filter narrowing the index.

    A failed enumeration answers 503 instead of falling back to the indexed names. The fallback would look like a complete list while being precisely the narrowed one the parameter exists to escape — the failure mode the parameter was added to fix, now silent. A build with no agent runner has no live enumeration at all and says so, for the same reason. The negative cache keeps a failure's error rather than only the fact of it, so a backed-off poll still answers 503 instead of a cached empty success. source=warehouse never reads the schema cache, so it also works on a build without that repository wired.

    The 503 body is generic and the detail stays in the log: these errors come from a warehouse driver and can quote the connection string the driver failed to parse, password included, and this route is open to a viewer. POST /test/warehouse does relay the agent's own message — and requires admin, which is the tier raw warehouse diagnostics belong to. The handler logs no driver text either. A first attempt redacted it instead, and the review round broke that in one line — a password holding an unescaped space defeats any pattern that stops at whitespace, and no pattern over arbitrary driver text is reliable enough to be the thing standing between a customer's password and a log sink. Nothing is lost by dropping it: the agent that actually talked to the warehouse logs its own failure, so this was a second copy. The negative cache holds a sentinel rather than the error for the same reason — its entries expire without being deleted, so a connection string stored there would outlive the data source that produced it.

    What this does not claim is a guarantee about the API process: in the docker and kubernetes runner modes the runner relays the agent's container output to the API's stderr so a run can be watched, which puts the agent's own line in the API log by a route no handler controls. That is pre-existing and mode-wide, and it is filed as #588 rather than reworked here. The code comment says so instead of implying the stronger guarantee.

    The 503 does not point at the data source's connection test as the way to diagnose it, because the cause need not be the connection: a registered ListTables filter failing for every dataset lands on the same response, and a connection test — which checks health, not the listing — would pass. Instead the API logs a failure class beside the project and data source: refused_by_warehouse_or_filter (the agent ran and said no), agent_failed_to_run, or agent_returned_no_result. Coarse, but it is the distinction an operator acts on and the one thing here that is safe to write to a log sink — and in the default subprocess runner mode the runner buffers the agent's stderr without writing it anywhere, so otherwise the failure left no trace at all.

  • The live-listing cache no longer grows without bound. Expiry only stopped an entry being reused; nothing deleted it. That was tolerable while the cache only ever held pre-index projects — a set that stops growing once they are indexed — but ?source=warehouse populates it on every scope-page open, and the key encodes the datasource config, so each warehouse edit mints a new key and abandons the old one. A long-running API accumulated the catalogue of every data source anyone had looked at or edited. Writes sweep expired entries now, each on its own TTL (the shorter one for a negative entry); writes are rare enough — the TTL and singleflight bound them — that sweeping on each is cheaper than the bookkeeping to avoid it.

  • A partial table enumeration is no longer reported as a complete one. The agent's --list-tables skips a dataset it can't read and succeeds on the strength of the others — right, because blanking a usable picker over one unreadable schema is worse — but it said nothing about the skip, so the caller received a short catalogue indistinguishable from a complete one. It now names them in unlisted_datasets, which GET /schema-cache/tables?source=warehouse passes through, omitted when the catalogue is complete so its presence is the signal. The default source doesn't carry it: its contract is "what is indexed" and it reaches the live listing only as a pre-index courtesy.

    Deliberately not a 503. Returning one would throw away the datasets that did list, which is the whole value of the best-effort skip; the caller needs to know the list is short, not to be denied it.

    The granularity is the dataset, and the field says so: a provider can also drop an individual table whose metadata it can't fetch and still return the rest without an error (#587), and ListTablesInDataset has no channel to report that.

  • One caller's disconnect no longer fails a shared table listing for everyone. The singleflight-coalesced enumeration ran under the first caller's request context, and singleflight hands the leader's error to every follower — which is then negative-cached for the fail TTL. A leader navigating away mid-listing therefore reported a healthy warehouse as unavailable to every other caller for the next 15 seconds. The shared run now uses context.WithoutCancel, keeping the request's values (the runner reads them) while dropping its cancellation; the lister still owns the deadline, derived from LIST_TABLES_TIMEOUT_SECONDS. The handler waits on DoChan rather than Do, so a disconnected caller returns immediately instead of sitting on the shared run for up to its full deadline — an abandoned request parked there also eats into the server's HTTP drain budget if a shutdown starts.

  • An upstream failure now carries the status the upstream used (#41). Provider.Chat returns a plain error, so every failure has looked alike to a caller for as long as the interface has existed: a prompt past the model's window, a parameter the model does not take, and a backend outage all arrive as "the provider failed". A caller that cannot tell them apart retries the ones that can never succeed, and reports the sender's own mistake as an internal error — which is what a managed gateway in front of this does today, answering 502 to a request the backend called invalid.

    New llm.UpstreamError carries the status, the upstream's own classification where it gives one, and a sanitised message; llm.UpstreamStatus and llm.UpstreamClientFault read it out of a wrapped chain. ClientFault is a 4xx that is not 408 or 429 — those two say "ask again later", so reading them as the caller's mistake would stop a retry that works. An unknown status reads as unknown, never as a client fault, so a provider that has not adopted this cannot have its failures reclassified.

    Adopted by the Bedrock wires and the LiteLLM provider, which is where a rejected request is most likely: enable_pre_call_checks on a proxy turns an over-long prompt into a 400, and Bedrock reports one as a ValidationException. The status is taken from the error through an interface assertion (HTTPStatusCode() int), so no SDK import is needed to read an AWS response error. Verified against a real model: a million-token prompt returns status 400, ValidationException: prompt is too long, and reads as a client fault, while a healthy call does not.

  • Four provider comments described the opposite of what NormalizeReasoningEffort does (#565). Each said a model the catalog does not know "keeps" its reasoning_effort. It does not: the helper requires positive catalog evidence and clears the field for anything else, which its own doc comment explains at length — the set of targets whose capability cannot be known is open, so no denial list covers it and a guess collects a 400.

    The behaviour is right and is not changed here. The comments are, in the four providers that carry the field as a plain request key. They matter because they sit at the call site, which is where someone decides whether to rely on the field: read as written, they promise that an effort set by a caller survives an opaque hop, and it does not.

    A test now pins the end-to-end behaviour on the LiteLLM provider — the one that registers no catalog and dispatches any model name, so every model it serves is unidentifiable and this is its normal case rather than an edge one. Asserted on the request that reaches the proxy, because that is what a reader of that comment actually wants to know.

Fixed

  • The Run discovery area picker offered the domain pack's areas, not the project's own (#573). A domain pack seeds a project's analysis areas once, at creation. After that the Playbook page is what defines them — it adds areas the pack never had, switches areas off and deletes custom ones — and the agent builds every run's list from the project, skipping anything disabled. The picker had never stopped reading the seed.

    So a custom area saved on the Playbook, badge and all, was simply absent from Run discovery → Select areas, and no reload brought it back: the only way to run one was POST /projects/{id}/discover with its id by hand. In the other direction the picker offered areas a run cannot execute — one switched off on the Playbook, or a custom one since deleted — and ticking one started a run that analysed nothing and then reported completed.

    The picker reads GET /projects/{id}/prompts now and lists the entries with enabled: true, which is exactly the set a run can execute, in the Playbook's own priority order. GET /domains/{domain}/categories/{category}/areas is unchanged and still right for a flow that picks a category before a project exists.

    Alongside it, POST /projects/{id}/discover answers 400 when areas is given and none of its ids is an enabled area on the project, naming the ids it can run, instead of reserving a run and spawning an agent with nothing to analyse. A request naming one enabled area and one disabled one still runs, as it always has; the agent works through the areas it resolved.

  • A structured answer cut off mid-object was reported as a finished one (#564). On a wire with no native response_format a schema is satisfied by forcing a single tool and folding its input back into the content, and NormalizeStructuredToolResponse ended by overwriting the stop reason unconditionally. That is right for the tool_use it hides — a hidden call must not leave a reason implying there is a call to execute — but it took max_tokens with it.

    A model cut off part-way through the object still emits a tool_use block, and the Bedrock wire appends the call whether or not its input parsed, so the fold ran and the truncation was erased. The caller could not detect it from the content either, because the fold re-marshals whatever parsed: valid JSON both ways. Measured against a real model — a request capped at 24 output tokens against a six-field required schema returned stop_reason: "end_turn" with the content {}, which reads as a complete empty answer rather than a truncated one. It now returns max_tokens, and a complete reply still returns end_turn.

    Only tool_use is rewritten now. Every other reason reaches the caller, which is what lets one decide between using an answer and asking again.

  • A tool call's numbers were rounded through float64. Three providers decoded a tool input into map[string]interface{} — the Anthropic wire on Bedrock, the Claude provider, and the shared OpenAI-compatible parser that the LiteLLM and OpenAI providers use — so any integer past 2^53 came back altered. A model answering the id 9007199254740993 reported 9007199254740992, including when the schema that asked for it had been forwarded exactly.

    All three now share one llm.DecodeToolInput, which decodes with UseNumber so the model's own digits survive. json.Number re-marshals as the text it was read from, so a folded structured answer carries them through to the caller unchanged. Verified against a real model returning that id inside a schema-constrained reply.

Release hygiene

Changelog [Unreleased] closed under 0.42.0 (#589).