Repository navigation
zgx Control room: Capture has its composer before there's a Brain dump - #1506
Open
grishnakov wants to merge 1 commit into
Open
grishnakov wants to merge 1 commit into
grishnakov wants to merge 1 commit into
Conversation
The engine makes a device's Brain dump with its first dump (orchestration/brain.rs `ensure_brain_dump`), but Capture's composer was bound to the Brain dump's chat and drew nothing without one: on a device that had never dumped, Capture was empty and the first dump couldn't be sent. - Until there's a Brain dump, Capture's composer (inline and floating) and its drop zones are bound to a stand-in chat. Its send goes as a dump with no chat, as before; the engine makes the Brain dump with it, and the composer is the Brain dump's once its row comes, the keys going on to it if they were in the stand-in's. - A model picked before the first dump has no chat to be set on: that dump runs on the engine's fast model, as one sent with no pick does. - control_world: `fixture.no_brain_dump`, and its dump stub brings the Brain dump back as the engine would; a test in control_receipt.
This branch has not been 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.
Targets #1474 (
zeron/orchestrators).Problem
On a profile that has never sent a dump, the Control room's Capture widget is empty: no composer at all. That means the first dump can't be sent.
The engine creates a device's Brain dump only when the first dump arrives (
ensure_brain_dumpincrates/engine/src/orchestration/brain.rs). Since c493ea3 ("Capture is the chat composer"), Capture's composer is bound to the Brain dump's chat. Inscreens/control/page.luau,brain_dump()returns nil when nobrain_dumporchestrator exists, soLaneTab.Composerrenders an emptyui.div {}. The control fixtures always seedorc-brain, so the tests never covered this.I hit it on a fresh data dir with this PR's build. Its only orchestrator was a standard one, so Capture was blank.
Fix
In
apps/zgx/ui/screens/control/page.luau:M.NO_BRAIN_DUMP. Side chats already bind a composer to an id the engine doesn't have yet (lanes.new_id), so this is a path the lane code supports.M.takeis unchanged. It still sendsorchestration.dump(..., brain_dump(), ...), so the first dump goes out with no chat, and the engine already handles that by creating the Brain dump.No engine or Rust changes.
Known limitation: a model picked before the first dump has no chat to be set on. The bridge only builds
configwhen it has a chat. So that one dump runs on the engine's default fast model, the same as a dump sent with no pick. Every later dump uses the picked model as before.Tests
control_world.luau: a newfixture.no_brain_dumpcommand removes the Brain dump. Its dump stub brings it back on the first dump, as the engine does, and notesdump-chat:nonewhen a dump is sent without a chat.control_receipt.test.luau: new test "capture has its composer before there's a Brain dump, and the first dump makes it". It checks that the composer is there, the first send is a dump with no chat, the composer then switches toorc-brainwith the keys kept, and the second dump is the Brain dump's. On the unfixedpage.luauit fails because there is no composer textbox.Run locally on Linux with the pinned zgx CLI (
e49ae7a3):zgx test ui capture: 13 passed.scripts/ci/test-zgx.sh ui: 16 tests failed that aren't on the known-failures list. I reran all 16 on this branch and on cc8ff03:control_qaProgress test).control tabs: a hidden tab does no work…andperf: one thread's status change, Progress alone. They passed 3 out of 3 alone on this branch.zgx linton the changed files: 0 errors, the same 8 token warnings as base.zgx check ui(luau-lsp 1.70.1): 941 errors and 82 warnings, identical to cc8ff03. The diagnostics in the changed files are the same ones, shifted by the added lines.I didn't do a manual run-through in the app.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.