Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(editor): a long question stops eating the agent drawer

esenginefbcdbe9d6118
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b596fad31..afa922051 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,18 @@ published separately; it ships inside the editor.
### Added
+- **The editor asks the TypeScript compiler about your project, and so can the
+ agent.** The open project gets a language service (TypeScript's own, in the
+ editor process — no separate server), and three doors onto it: writing a `.ts`
+ file now **answers with that file's type errors**, `check_scripts` asks for them
+ at any time, and `lookup_symbol` gives a name's real signature, its doc comment
+ and where it is declared. `search_project_files` finds a line anywhere in the
+ project. Between them they replace the two things an agent had before: entering
+ play to find out whether its code compiled, and paging a 50 000-line `.d.ts` a
+ hundred lines at a time to learn one method name — which cost most of a context
+ window per API. A dogfood run that built a game spent 17 lookups and stayed
+ under 20k of context where the previous one passed 70k without writing a line.
+
- **A sorting layer can resolve by depth instead of paint order — 2.5D.** Check a
layer under Project Settings → Rendering → Depth-sorted layers and what covers
what is decided by the depth buffer, from each entity's `Transform` z; with a
@@ -77,6 +89,34 @@ published separately; it ships inside the editor.
### Fixed
+- **The agent's brief taught an API that does not exist, and nothing compiled
+ it.** It said to read the mouse with `input.isMouseButtonPressed(MouseButton.Left)`.
+ `MouseButton` is the InputMap binding builder — a function, with no `.Left` — so
+ the call passed `undefined` and read false forever: every game the agent built
+ ignored the mouse, in silence, with nothing failing anywhere. The brief now
+ teaches `isMouseButtonPressed(0)` and says what `MouseButton` is for, and every
+ API it teaches is exercised by a fixture that CI compiles against the real SDK
+ types. Prose about an API is code that nothing checks.
+
+- **The agent has to look at what it built before it says it is done.** A turn
+ that changed the scene and never once captured the viewport is asked to, before
+ it can report. Diagnostics only cover what the editor can name; whether the
+ content is on camera, whether it reads, whether it is where it was meant to go
+ are things only the picture answers — and a dogfood run delivered a board half
+ off screen with every write compiling and every diagnostic clean.
+
+- **A turn that runs out of rounds lands its work instead of being cut off.** The
+ per-turn cap (a backstop against a model retrying a failing call forever) was
+ low enough that building a small game hit it, and it arrived without warning —
+ so the round in which the agent would have summarised where things stood was
+ the one it never got, and an unfinished turn looked exactly like a finished
+ one. The cap is higher, and eight rounds out the agent is told to wrap up.
+
+- **A long question stops eating the agent drawer.** The running turn's header is
+ pinned so you can see which request is in flight; unclamped, a pasted paragraph
+ of requirements held the top of the panel for the whole run and pushed the work
+ itself off screen. It clamps to two lines now, with the full text on hover.
+
- **The viewport still draws on a machine with no usable GPU.** Chromium refuses
WebGL2 outright ("WebGL2 blocklisted") where no hardware GL is available — a VM,
a remote desktop, a blocklisted driver, a CI runner — unless software rendering
diff --git a/desktop/src/components/AgentDrawer.tsx b/desktop/src/components/AgentDrawer.tsx
index 27fede5e0..052e2c1e8 100644
--- a/desktop/src/components/AgentDrawer.tsx
+++ b/desktop/src/components/AgentDrawer.tsx
@@ -657,7 +657,9 @@ const Turn = memo(function Turn({ turn, isLast, running, until }: {
<button type="button" className="ag-th" onClick={() => setFolded((f) => !f)}>
<span className="ag-hrow">
<ChevronRight size={12} strokeWidth={2} className="ag-fold" />
- <span className="ag-req">{turn.prompt}</span>
+ {/* `title` because the pinned copy is clamped: the whole question is
+ still one hover away without giving it the screen. */}
+ <span className="ag-req" title={turn.prompt}>{turn.prompt}</span>
{/* A bad answer three turns in should cost you that answer, not the
whole conversation that led to it — and the reason to re-ask is
usually that the question could have been put better, so this
diff --git a/desktop/src/theme/agent.css b/desktop/src/theme/agent.css
index 9f0e90f1c..98c201585 100644
--- a/desktop/src/theme/agent.css
+++ b/desktop/src/theme/agent.css
@@ -156,6 +156,18 @@
transition: background var(--t-fast);
}
.ag-turn.current > .ag-th { position: sticky; top: 0; z-index: 3; }
+/* The pinned header exists to say WHICH turn is running, not to reprint the
+ question. Unclamped it grew with the prompt, and a long one (a paste, a spec,
+ a paragraph of requirements) held the top of the drawer for the whole run —
+ pushing the thing you actually wanted to watch, the work, off screen. Two
+ lines identify it; `title` on the span carries the rest. Only while pinned:
+ scrolled-back turns are ordinary content and print in full. */
+.ag-turn.current > .ag-th .ag-req {
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
.ag-th:hover { background: var(--elevated); }
.ag-hrow { display: flex; align-items: flex-start; gap: 9px; }
.ag-fold { color: var(--text-faint); margin-top: 3px; flex: none; transition: transform var(--t) var(--e-out); }