Repository navigation
feat(platform): chat makes files and uses skills, sandbox only as needed - #4817
Conversation
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.
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.
|
Merge queue rejected #4817 at Agent #2, Independent Review ( What failed
Comparison with main: the main push Checks at 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 ( |
|
The W18 failure does not come from this PR. The same probe failed with the same signature ( |
What
Chat can now make things, and picks the cheapest way that does the job:
create_file(Markdown/CSV/JSON/HTML/SVG/ics/vcf/code, ≤1 MB);load_skill/read_skill_file;generate_image(when image generation is on)run_code(Python/Node/Bash) in a light sandbox: hardeneddefaultprofile, starts in ~1 s, one per conversation, files kept between calls, removed after 5 idle minutesThe model decides via tool choice (tool contracts + a "make things" ladder in the persona); the platform provisions lazily and governs:
chat_tools: files / skills / code, default on) +image_generationfor images.maxLightSessionsPerOrg, default 2) with LRU-idle preemption, busy answer, watchdog idle release, pin refused.artifactMessagePart (REST 3.36.0ArtifactPart).lib/agent/*,backend/domains/agent_tools/*) are runtime-agnostic: the same tool table/executors are meant for the native task turn next.Evaluation (tier decision, 40 prompts)
claude -pwith the real rendered system prompt + wire tools;run_codeexecuted for real in the runtime image (hardened like the default profile).* "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
platform/chat/files-and-skills(EN/DE/FR); basics, overview, skills, content-models, policies-and-limits, admin/sandboxes updated; screenshots retaken/added.e2e:make-file/e2e:make-spreadsheet.Follow-ups (not in this PR)
Verification
tsc --noEmit(platform, shared), type-aware oxlint on every changed file, oxfmt check, knip, lint:links, lint:manual (1749 boxes), domain-spec guard.run_codemakesplanets.xlsxin 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 refusesrun_codeeven when a model calls it.