Repository navigation
feat(playground): Studio chat builds sequence diagrams - #377
Merged
Merged
Conversation
This was referenced Oct 10, 2026
Collaborator
Author
This was referenced Oct 10, 2026
anandpant
force-pushed
the
feat/sequence-studio-chat
branch
from
October 10, 2026 22:11
08de351 to
7317dda
Compare
anandpant
force-pushed
the
feat/sequence-activations
branch
from
October 10, 2026 22:11
be34ec4 to
664fc62
Compare
anandpant
marked this pull request as ready for review
October 10, 2026 22:12
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This was referenced Oct 10, 2026
Merged
anandpant
force-pushed
the
feat/sequence-studio-chat
branch
from
October 11, 2026 00:37
7317dda to
7ae0ca9
Compare
anandpant
force-pushed
the
feat/sequence-activations
branch
from
October 11, 2026 00:37
664fc62 to
67439dc
Compare
anandpant
force-pushed
the
feat/sequence-studio-chat
branch
from
October 11, 2026 01:39
7ae0ca9 to
f931d5f
Compare
Merge activity
|
graphite-app
Bot
force-pushed
the
feat/sequence-activations
branch
from
October 11, 2026 01:49
de73f7e to
49c0292
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Oct 11, 2026
## What changed
- Studio chat (`/api/chat`, the playground home) exposes a `build_sequence_diagram` tool next to `build_flowchart`. Its input is the new `BuildSequenceDiagramToolInputSchema` (sequence spec without style or artifact options). Its output is the canonical `BuildSequenceDiagramResult`. It runs on the shared Code Mode `buildSequenceDiagram` vertical.
- Both tools share a per-turn executor, `makeStudioBuildToolExecutor`: a three-attempt budget per tool, host-injected artifact options, reuse of the accepted result, and optional grounding (flowchart logo placement stays as is). `MAX_FLOWCHART_BUILD_ATTEMPTS` is now `MAX_DIAGRAM_BUILD_ATTEMPTS`.
- The agent system prompt picks the family: sequence for time-ordered interactions, and always when a sequence diagram is asked for. It adds sequence craft rules: participants, chronological messages, and returns that close calls (which draws activation bars).
- The playground UI reads either tool part for progress titles ("Drawing your sequence diagram"), participant ghost labels while drawing, result details, failure copy (`invalid_sequence`), the stage, and downloads. One starter now asks for a sequence diagram.
- The chat repair retry metric and log are renamed to `sketchi_chat_build_retries` and "Retrying Studio diagram repair", with an `operation` label. The telemetry log allowlist is updated to match.
## Why
#280 asks that natural-language generation in Studio chat handle sequence explicitly. Before this, the only thing Studio could build was a flowchart.
## Verification
- `pnpm nx affected -t typecheck,test --base=origin/main` (18 projects)
- New tests: sequence tool contracts, build with host options and accepted-result reuse against the real Code Mode runtime, repair issues and attempt cap, policy routing, and UI selectors for sequence tool parts
- The live Studio flow in Chrome is checked at the end of the stack, with real model calls.
Refs #280
## Review follow-ups
- **One budget per turn:** both tools share one `StudioBuildTurn`, with one attempt counter (three total), one accepted artifact, and one build at a time. A call to the other tool after acceptance returns a rejection without building. Tests: a flowchart is accepted, then a sequence call causes 0 new writes; a mixed retry sequence caps at three attempts.
- **Routing:** a type the user names wins over the topic in both directions ("a flowchart of an OAuth handshake is still a flowchart"); with no type named, content decides. `pnpm eval:studio-routing` (`tools/studio-routing-eval.ts`) runs four maintained cases (named or unnamed type × either family) against a live playground's `/api/chat` and scores the first build tool called. Its stream parsing and case coverage are unit-tested.
- **Size limits:** `SEQUENCE_MAX_PARTICIPANTS = 12` and `SEQUENCE_MAX_MESSAGES = 40` in core validation, reported as Code Mode `sequence_too_large` (registered as a post-baseline code in the compatibility corpus). The issue list is capped at 20. The limits sit above the prompt's craft targets (2–8 participants, ≤30 messages) so Code Mode and MCP callers keep headroom: 12 columns are about 3,800px wide and stay well under canvas element limits. The prompts now state both the target and the limit.
- **Stopped calls:** a tool call left in an input state when its run is no longer active shows "Stopped drawing your …" with a Stopped badge, for both families (`diagramToolCardStatus`, tested).
graphite-app
Bot
force-pushed
the
feat/sequence-studio-chat
branch
from
October 11, 2026 01:49
f931d5f to
11e5330
Compare
## What changed
- Studio chat (`/api/chat`, the playground home) exposes a `build_sequence_diagram` tool next to `build_flowchart`. Its input is the new `BuildSequenceDiagramToolInputSchema` (sequence spec without style or artifact options). Its output is the canonical `BuildSequenceDiagramResult`. It runs on the shared Code Mode `buildSequenceDiagram` vertical.
- Both tools share a per-turn executor, `makeStudioBuildToolExecutor`: a three-attempt budget per tool, host-injected artifact options, reuse of the accepted result, and optional grounding (flowchart logo placement stays as is). `MAX_FLOWCHART_BUILD_ATTEMPTS` is now `MAX_DIAGRAM_BUILD_ATTEMPTS`.
- The agent system prompt picks the family: sequence for time-ordered interactions, and always when a sequence diagram is asked for. It adds sequence craft rules: participants, chronological messages, and returns that close calls (which draws activation bars).
- The playground UI reads either tool part for progress titles ("Drawing your sequence diagram"), participant ghost labels while drawing, result details, failure copy (`invalid_sequence`), the stage, and downloads. One starter now asks for a sequence diagram.
- The chat repair retry metric and log are renamed to `sketchi_chat_build_retries` and "Retrying Studio diagram repair", with an `operation` label. The telemetry log allowlist is updated to match.
## Why
#280 asks that natural-language generation in Studio chat handle sequence explicitly. Before this, the only thing Studio could build was a flowchart.
## Verification
- `pnpm nx affected -t typecheck,test --base=origin/main` (18 projects)
- New tests: sequence tool contracts, build with host options and accepted-result reuse against the real Code Mode runtime, repair issues and attempt cap, policy routing, and UI selectors for sequence tool parts
- The live Studio flow in Chrome is checked at the end of the stack, with real model calls.
Refs #280
## Review follow-ups
- **One budget per turn:** both tools share one `StudioBuildTurn`, with one attempt counter (three total), one accepted artifact, and one build at a time. A call to the other tool after acceptance returns a rejection without building. Tests: a flowchart is accepted, then a sequence call causes 0 new writes; a mixed retry sequence caps at three attempts.
- **Routing:** a type the user names wins over the topic in both directions ("a flowchart of an OAuth handshake is still a flowchart"); with no type named, content decides. `pnpm eval:studio-routing` (`tools/studio-routing-eval.ts`) runs four maintained cases (named or unnamed type × either family) against a live playground's `/api/chat` and scores the first build tool called. Its stream parsing and case coverage are unit-tested.
- **Size limits:** `SEQUENCE_MAX_PARTICIPANTS = 12` and `SEQUENCE_MAX_MESSAGES = 40` in core validation, reported as Code Mode `sequence_too_large` (registered as a post-baseline code in the compatibility corpus). The issue list is capped at 20. The limits sit above the prompt's craft targets (2–8 participants, ≤30 messages) so Code Mode and MCP callers keep headroom: 12 columns are about 3,800px wide and stay well under canvas element limits. The prompts now state both the target and the limit.
- **Stopped calls:** a tool call left in an input state when its run is no longer active shows "Stopped drawing your …" with a Stopped badge, for both families (`diagramToolCardStatus`, tested).
graphite-app
Bot
force-pushed
the
feat/sequence-studio-chat
branch
from
October 11, 2026 01:55
11e5330 to
8e18e19
Compare
Contributor
Sketchi Web PreviewStatus:
Deletion pending: Cloudflare deleted this Preview, but its URL is still reachable and serves this PR's code (cloudflare/workers-sdk#15945). The cleanup job failed so this stays visible. |
Contributor
Sketchi Icons PreviewStatus:
|
Contributor
Sketchi Eval Harness PreviewStatus:
|
Contributor
Sketchi Excalidraw Workspace PreviewStatus:
|
Contributor
Sketchi Playground / Studio PreviewStatus:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
/api/chat, the playground home) exposes abuild_sequence_diagramtool next tobuild_flowchart. Its input is the newBuildSequenceDiagramToolInputSchema(sequence spec without style or artifact options). Its output is the canonicalBuildSequenceDiagramResult. It runs on the shared Code ModebuildSequenceDiagramvertical.makeStudioBuildToolExecutor: a three-attempt budget per tool, host-injected artifact options, reuse of the accepted result, and optional grounding (flowchart logo placement stays as is).MAX_FLOWCHART_BUILD_ATTEMPTSis nowMAX_DIAGRAM_BUILD_ATTEMPTS.invalid_sequence), the stage, and downloads. One starter now asks for a sequence diagram.sketchi_chat_build_retriesand "Retrying Studio diagram repair", with anoperationlabel. The telemetry log allowlist is updated to match.Why
#280 asks that natural-language generation in Studio chat handle sequence explicitly. Before this, the only thing Studio could build was a flowchart.
Verification
pnpm nx affected -t typecheck,test --base=origin/main(18 projects)Refs #280
Review follow-ups
StudioBuildTurn, with one attempt counter (three total), one accepted artifact, and one build at a time. A call to the other tool after acceptance returns a rejection without building. Tests: a flowchart is accepted, then a sequence call causes 0 new writes; a mixed retry sequence caps at three attempts.pnpm eval:studio-routing(tools/studio-routing-eval.ts) runs four maintained cases (named or unnamed type × either family) against a live playground's/api/chatand scores the first build tool called. Its stream parsing and case coverage are unit-tested.SEQUENCE_MAX_PARTICIPANTS = 12andSEQUENCE_MAX_MESSAGES = 40in core validation, reported as Code Modesequence_too_large(registered as a post-baseline code in the compatibility corpus). The issue list is capped at 20. The limits sit above the prompt's craft targets (2–8 participants, ≤30 messages) so Code Mode and MCP callers keep headroom: 12 columns are about 3,800px wide and stay well under canvas element limits. The prompts now state both the target and the limit.diagramToolCardStatus, tested).