Skip to content

feat(platform): chat makes files and uses skills, sandbox only as needed - #4817

Merged
yannickmonney merged 8 commits into
mainfrom
feat/chat-work-tools-light-sandbox
Oct 12, 2026
Merged

yannickmonney merged 8 commits into
mainfrom
feat/chat-work-tools-light-sandbox

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What

Chat can now make things, and picks the cheapest way that does the job:

Tier Tool(s) What starts
none answer inline; create_file (Markdown/CSV/JSON/HTML/SVG/ics/vcf/code, ≤1 MB); load_skill / read_skill_file; generate_image (when image generation is on) nothing
light run_code (Python/Node/Bash) in a light sandbox: hardened default profile, starts in ~1 s, one per conversation, files kept between calls, removed after 5 idle minutes one small sandbox
full hand-over to a project task (existing standard agent / project agents) the agent's own sandbox

The model decides via tool choice (tool contracts + a "make things" ladder in the persona); the platform provisions lazily and governs:

  • Chat tools policy (chat_tools: files / skills / code, default on) + image_generation for images.
  • Light sandboxes limit (maxLightSessionsPerOrg, default 2) with LRU-idle preemption, busy answer, watchdog idle release, pin refused.
  • Produced files are thread-bound file rows (lineage root), shown under the reply as cards (preview + download) / image gallery; artifact MessagePart (REST 3.36.0 ArtifactPart).
  • run_code delivers new/changed outputs once (in-sandbox delivered-files record); a revised document replaces its earlier card in the same reply.
  • Skills: per-person catalog (≤40, sanitized) behind the cache breakpoint; bundles staged into run_code.
  • Chat image billing: budget admission with the reply's hold, settled per charge, 16 images per reply.
  • Shared modules (lib/agent/*, backend/domains/agent_tools/*) are runtime-agnostic: the same tool table/executors are meant for the native task turn next.
  • Runtime image: python-docx + matplotlib added to the hash-locked document requirements (both archs, 90-day release age).

Evaluation (tier decision, 40 prompts)

claude -p with the real rendered system prompt + wire tools; run_code executed for real in the runtime image (hardened like the default profile).

Haiku Sonnet
no-sandbox requests (24) 24/24 24/24
light requests (13) 13/13 13/13
full requests (3) 3/3* 3/3*
matching skill loaded first (10) 10/10 4/10

* "small React app with tests, zipped" was built, tested (19 / 8 passing) and zipped inside the light sandbox in 50–80 s — light-tier work, not a full sandbox. Rendered deliverables reviewed visually (Word reports, invoices, decks, charts, schedules, QR code); one model slip (reportlab bullet).

Docs / tests

  • New page platform/chat/files-and-skills (EN/DE/FR); basics, overview, skills, content-models, policies-and-limits, admin/sandboxes updated; screenshots retaken/added.
  • Manual boxes CHAT-F66–F71, CHAT-B22–B24, CHAT-A10, GOV-F65/F66, SET-F83/F84; spec rules CHAT-R18–R24, SBX-R22–R25.
  • Unit/component tests for every rule; mock gateway scenarios e2e:make-file / e2e:make-spreadsheet.

Follow-ups (not in this PR)

  • Native-first task runs on the same shared tools (task turn), escalation to the full harness.
  • Let run_code return small preview images to the model for visual QA.
  • REST download door for chat files.

Verification

  • tsc --noEmit (platform, shared), type-aware oxlint on every changed file, oxfmt check, knip, lint:links, lint:manual (1749 boxes), domain-spec guard.
  • Platform server + pii suites (full run), docs structural suite, platform i18n suites (report-mode findings on new strings resolved).
  • Real browser on an isolated stack with the real spawner: run_code makes planets.xlsx in a light sandbox → card under the reply → in-app preview renders it; Settings › Sandboxes lists the chat sandbox (Destroy, no Pin); Chat tools › Code off persists and the server refuses run_code even when a model calls it.
  • Docs screenshots captured through the manifest pipeline (2 new, 2 retaken).

The chat's run_code tool promises Word files and charts; the document
lock lacked both libraries. Adds python-docx 1.2.0 and matplotlib 3.11.0
with their new dependencies (contourpy, cycler, fonttools, kiwisolver,
pyparsing), hash-locked for cp312 manylinux amd64 and arm64, resolved
against the existing pins (none moved) and published over 90 days ago.
The chat assistant can now make what it is asked for, choosing the
cheapest way that does the job:

- none: answer inline; create_file writes text files (Markdown, CSV,
  JSON, HTML, SVG, ics, vcf, code); load_skill / read_skill_file read the
  person's skill library; generate_image when image generation is on.
- light: run_code runs Python, Node or Bash in a light sandbox — the
  hardened default profile, one per conversation (lineage root), started
  in about a second, files kept between calls, removed after five idle
  minutes; the least recently used idle one gives way at the limit,
  otherwise the call is answered busy.
- full: work for a repository, a browser or hours goes to a project task.

The model decides through the tools' contracts and a work ladder in the
persona (unchanged prompt when no work tool is offered). The platform
governs: a chat_tools policy (files, skills, code; on by default), the
image_generation policy, a light sandbox limit (maxLightSessionsPerOrg,
default 2) with watchdog release and pin refusal, budget admission and
per-charge booking for chat images (16 per reply).

Produced files are thread-bound file rows shown under the reply as cards
(preview, download under their name) or as an image gallery, carried as
an artifact message part (REST contract 3.36.0, ArtifactPart). run_code
attaches new or changed outputs once, tracked inside the sandbox; a
document revised later in the same reply replaces its earlier card.

The tool table and executors (lib/agent, backend/domains/agent_tools) are
runtime-agnostic, for the native task turn to share. Settings gain the
Chat tools section and the Light sandboxes limit; chat sandboxes read as
such in the workspace list. Manual boxes, spec rules CHAT-R18–R24 and
SBX-R22–R25, mock scenarios and tests come with it.
A new page, Make files and use skills in chat (EN/DE/FR), covers how the
assistant picks the lightest way to make a file, where files appear,
changing an attached file, skills, and the limits. Chat basics, the chat
overview and the skill library no longer say chat cannot make files or
use skills; image generation now covers the chat; Policies and limits
gains Chat tools; Sandboxes gains the Light sandboxes limit and how chat
sandboxes behave. Screenshots: the reply with its file card and the Chat
tools section are new, the sandbox limits and image generation retaken.
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 11, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 11, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 11, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 11, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 12, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 12, 2026
The offline document tools check of the sandbox runtime image asserts that
the pinned requirements and its own table of import names name the same
distributions. The runtime now also pins python-docx and matplotlib with
their dependencies (contourpy, cycler, fonttools, kiwisolver, pyparsing), so
the table lists them — without it the image validation fails on its first
assertion, and the merge queue with it.
Matplotlib looks for its configuration under a home that is read-only in a
light sandbox, so every call fell back to a fresh temporary directory,
rebuilt the font cache (about 1.3 s) and printed a warning the model then
read in the stderr tail. Programs now run with MPLCONFIGDIR in the
workspace, which lives as long as the sandbox does — only the first chart of
a sandbox pays for the cache, later ones take about half a second — and with
the Agg backend, since a chart is drawn to a file, never to a screen.
…n shim

The chat's work tools composed the credential, organization and governance
handlers by hand to resolve the image model, importing one of them from the
knowledge service. Main has since moved that handler out of the service, so
the branch no longer compiled against it. The image model is now resolved
over `chatShimHandlers`, the map the chat turn resolves its own model over,
which carries the same three whichever module hosts them.
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 12, 2026
@yannickmonney

yannickmonney commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge queue rejected #4817 at 6913141d65: one Backend integration failure (diagnosis note; no review verdict)

Agent #2, Independent Review (3f9fdcee), TALE-359 run 01f5326f, 2026-10-12 07:56Z.

What failed

  • merge_group Checks 38219258800 at cdc5a71043 failed only on Backend integration (job 114711297376): [itest] 2051/2052 checks passed across 265/265 lanes.
  • The one failing check is standing-role wake: scenario W18 variants ran to its end — itest: W18 manager admission not observed. Every variant reports outcome: "not_admitted", fired: 0, waiting: 7.
  • The other 6 workflows were green, and so were the other Checks jobs. The queue removed the PR.

Comparison with main: the main push Checks at acd5dbd107 (run 38198509344, job 114646470876) passed Backend integration 2052/2052. So this is not a known main-side failure. Either this PR changes something the W18 wake/admission path depends on, or it is a timing flake. I have not determined which.

Worth checking first: the PR adds light-sandbox sessions with their own per-organization limit, LRU-idle preemption and a busy answer. Check whether any of that changes the session and admission counting that the standing-role manager admission in W18 relies on.

Review status: this PR has no independent review record (0 reviews, 0 comments) for 144 files and +8124/−283, including a new code-execution surface (run_code in light sandboxes) and file creation. An exact-head independent review, with security focus, should precede the next enqueue. I have not reviewed it, and this note is not a verdict.

@yannickmonney
yannickmonney added this pull request to the merge queue Oct 12, 2026
@yannickmonney

Copy link
Copy Markdown
Contributor Author

The W18 failure does not come from this PR. The same probe failed with the same signature (standing-role wake: scenario W18 variants, every variant not_admitted, fired: 0, waiting: 7, occurrence failed) in merge_group run 38195298425 for #4405, whose group was main at b0df4d2a44 plus #4405 only: 2050/2051 checks, no light-sandbox change in it. The queue ran this PR's group at cdc5a71043 with 2051/2052, and the other 6 workflows were green. Re-queued at 07:59Z with gh pr merge --auto; the head is unchanged at 6913141d65.

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.

1 participant