Skip to content

feat(platform): name the serving release in workspace_status - #3972

Merged
yannickmonney merged 3 commits into
mainfrom
feat/workspace-status-platform-version
Sep 30, 2026
Merged

yannickmonney merged 3 commits into
mainfrom
feat/workspace-status-platform-version

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

An agent inside a sandbox can reach the authenticated workspace bridge but not the public /api/health (TALE-370), so it had no supported way to read which Tale release the platform reports. workspace_status now answers that from the server's side.

What changed

POST /api/tools/status, the door behind the in-sandbox workspace_status MCP tool, adds platform beside the tool listing, which stays as it was:

{"tools":[{"name":"task_get","description":"…","readOnly":true}],"platform":{"version":"0.5.64"}}
{"tools":[],"note":"No workspace tools are granted to this agent.","platform":{"version":"0.5.64"}}
{"tools":[…],"platform":{"version":null,"note":"This backend's build is labelled as a development build, not with a release version."}}
  • Source: the backend process's own TALE_VERSION, the build stamp the web tier's /api/health also reports. release.yml sets it to the tag's number without the v. The Build workflow sets candidate-sha-…, pr-…-sha-… or sha-…, a local build sets dev, and the environment can override it.
  • A release label, never proof: version is the trimmed stamp only when it has the release shape release.yml validates (0.5.64, 0.6.0-rc.1). Every other stamp answers version: null with one fixed sentence about the label: none, dev, or not a release version. Nothing else is ever sent: no raw label, address, org data or Ops identifier.
  • Server-owned: the door reads nothing but the bearer token from the request. The grants come from the session-token row and the version from the process. A forged body, query or header changes nothing. The 401 for a missing, malformed, unknown or expired token is byte-identical and carries no platform.
  • Reuse: the release shape was a private regex in the device dialog (device-command.ts, the CLI pin). It moved to lib/shared/release-version.ts and both the dialog and the backend now use it (commit 1, behaviour-identical). The workspace has one copy; two other identical copies live in other workspaces and are unchanged (see below). workspaceToolStatusImpl's return type went from unknown to a concrete type so the door can spread it.
  • Bridge: relay code is unchanged; it already passes the text through untouched. The workspace_status description now says what platform.version is: the label of the backend that answered the call, null when its build has none, and absent on an older platform. It also says the value is not proof of what is deployed or of its health. The description ships with the sandbox-runtime image of the same release.
  • Docs: EN/DE/FR platform/agents/harnesses.md, section "Understand files and connected tools", gets one paragraph. The manual register services/platform/tests/manual/reference/automation.md gets one row.

No DB/schema, REST v1/OpenAPI, error-code, i18n-catalog, grant, tool or endpoint change.

What it is not

  • Only the backend that answered: it names the build label of the instance that answered. During a blue-green switch or with several replicas, another instance can answer the next call.
  • A label, not proof of provenance: any build can carry a release number. For example, compose.yml builds locally by default with VERSION: ${VERSION:-dev}, and env_file can override TALE_VERSION.
  • Not health: it is not deployment health and not a native Ready receipt; Ops keeps owning those checks.
  • How a release reader should use it: confirm only an exact match of platform.version with the published tag's number. Treat null, a missing field or a mismatch as unconfirmed, and rely on the deployment's own records for what is running.

Review

An independent adversarial read of 529bdf25d found no correctness or security defect: the door, the refusals, the shape, type safety, the shared stamp, the relay and the tests all held. It did find wording that claimed more than a label can show. 29ee59275 fixes that:

  • The docs, the bridge description and the code comment now say "label". They no longer say "a non-release build never matches" or "confirms exactly that build".
  • The notes describe the label, not the build.
  • The bridge description names "the backend that answered this call" rather than the session's, and says an older platform omits the field.
  • French uses "le tag" (glossary git_tag); German uses "können … abfragen" and drops an ambiguous pronoun.
  • The door comment and the register row say that only the bearer token is read.
  • The release-label tests compare whole answers.

Verification (exact head 29ee59275, local, synthetic fixtures only)

Check Result
backend/domains/sandbox/dispatch-routes.test.ts: the grants and no-grants answers equal the real listing plus platform, and a spy asserts the token's grants. Four refusals get a byte-identical 401 with no platform. A forged body, query or header, or a non-JSON body, changes nothing. Ten non-release stamps answer null with their note. Trimmed and prerelease stamps compare as whole answers 23/23 ✅ (16 new)
Eight mutations of the door and helper: drop platform, trust the body's version, trust the body's grants, a 401 carrying platform, echo non-release labels, missing read as dev, no trim, a stray note beside a release each fails the test that names it ✅; sources restored byte-identical
lib/shared/release-version.test.ts (shape), device-command.test.ts (pin unchanged) 2/2, 3/3 ✅
services/sandbox-runtime/daemon/src/tale-connectors-mcp.test.ts: the real bridge process against a fake platform. The status text (indented, with ≤, … and an escaped \u2026) reaches the model byte for byte, the platform receives {} despite forged MCP arguments, and the description states the limits 5/5 ✅; the re-serialize, forward-args and drop-platform mutations are all caught
backend:integration lane checkSandboxSpawner on scratch Postgres 16: the new check "workspace status names the serving release" with a real session token, a no-grants token, a forged body, an expired token and a candidate stamp PASS: release=0.5.99 (200), noGrants=0 tools/0.5.99, forged answer identical=true, expired → 401 {"status":"error","message":"Unauthorized."}, candidate=null (label echoed=false)
Tests that import a changed module (transitive scan: 11 server files, re-run on this head; 23 jsdom and 5 Chromium files, run at 529bdf25d, whose inputs are unchanged) 196 + 157 + 46 ✅
Source-scanning guards (tests/guards/*, error codes, handler names, shims, OpenAPI spec, rate limit, invalid body, purity, conventions) 24 + 6 + 3 files ✅
Scoped tsc (changed files and importers, including app.ts and integration-check.ts); daemon tsc; oxlint --type-aware; oxfmt --check; opengrep on the changed files; lint:manual; docs structural suite (27 files, 139 tests) all clean ✅
CI at 529bdf25d 57 pass, 13 skipped. The platform unit, ui, browser, typecheck and lint tasks, the daemon test, typecheck and lint, and the docs test all executed (turbo cache miss)

Known and not changed here

  • Pre-existing on main: the older check in the same lane, "workspace-tool door (session-token auth + reused bridge)", also fails on clean b5ff70447. Its product_find answers run_ended ("The task run this session served has ended…") because the lane's project_agent session has no live task run. The new check does not depend on it. backend:integration is not a CI job.
  • Pre-existing turbo inputs gap: @tale/sandbox-runtime-daemon#test runs nine runtime scripts from outside its workspace, and no inputs entry covers them: entrypoint.sh, tale-connectors-mcp, tale-hermes-run, tale-openclaw-run, tale-playwright-mcp, tale-qwen-run, tale-steer-hook, tale-vision, tale-vision-read-hook. This PR edits the test too, so CI re-ran it here. An edit to a script alone replays a cached verdict. Suggested follow-up: services/sandbox-runtime/daemon/turbo.json inputs with $TURBO_EXTENDS$, $TURBO_DEFAULT$ and those scripts, plus a guard like services/docs/tests/turbo-inputs.test.ts.
  • Other copies of the release shape: tools/cli/src/lib/sandbox-device/config.ts and services/sandbox/src/devices/messages.ts each keep an identical isReleaseVersion. Consolidating the three into @tale/shared would be a small follow-up.
  • Release lane observation (from reading, not run): release.yml also triggers on a bare 0.5.64 tag, and gh release create v<number> has no --target. After a bare-tag push, gh would create v0.5.64 at the default branch's head, which could differ from the tagged source. The documented procedure pushes vX.Y.Z, so this only matters off that path.

Overlap

#3961, #3948 and #3881 also touch automation.md or integration-check.ts. git merge-tree shows that this branch adds no conflict with any of them; #3881's conflict set is the same against plain main.

Source identities

  • Base: origin/main b5ff70447.
  • v0.5.64: ebf4546fb1455a236c1046f3d73ef78c2e1d0109 is untouched and does not contain this change.
  • Version sources read:
    • .github/workflows/release.yml: the VERSION_NUMBER check and the build argument.
    • services/platform/Dockerfile: the runner and squash ENV TALE_VERSION.
    • compose.yml: backend-api runs the platform image, which compose builds locally by default with VERSION: ${VERSION:-dev}; env_file can override TALE_VERSION.

Closes #3969

The device dialog kept the release shape `release.yml` checks (a bare
X.Y.Z, optionally with a prerelease) as a private regex. Move it to
lib/shared so the backend can apply the same rule to its own build stamp
instead of growing a second copy. The dialog's pin is unchanged.
An agent in a sandbox reaches the authenticated workspace bridge but not
the public /api/health, so it had no supported way to read which release
serves it. POST /api/tools/status now adds `platform.version` beside the
unchanged tool listing: the backend's own TALE_VERSION when it has the
release shape (`0.5.64`), else null with a fixed note for an unset stamp,
a dev build or any other label, which is never echoed. The door reads
nothing from the request, and a refused token still gets the bare 401.

The value names the backend that answered, not deployment health. The
in-sandbox bridge already relays the answer verbatim; its workspace_status
description now says what the field means. Covered by the door and bridge
suites, the checkSandboxSpawner lane, the EN/DE/FR harness docs and the
manual automation register.

Refs #3969
The version workspace_status reports is whatever release number the
backend's build stamp carries: any build can be stamped with one, and
the environment can override the stamp. The docs, the bridge
description and the code comments said a non-release build never
matches a release and that a match confirms the build. Say instead that
the value is a label to map to the published tag, not proof of what is
deployed.

Word the three notes as facts about the label, name the backend that
answered the call rather than the session's, say an older platform
omits the field, use "tag" in French and fix the German modal and
pronoun. The door comment and the register row now say the bearer token
is the one thing read from the request. The release-label tests compare
whole answers, so a stray note beside a version fails them.

Refs #3969
@yannickmonney
yannickmonney merged commit 8fdb659 into main Sep 30, 2026
70 checks passed
@yannickmonney
yannickmonney deleted the feat/workspace-status-platform-version branch September 30, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose serving platform version through existing workspace status

1 participant