Repository navigation
Conversation
simonklee
force-pushed
the
oc-rust
branch
7 times, most recently
from
November 14, 2026 21:04
679528c to
4dacfbf
Compare
simonklee
force-pushed
the
oc-rust
branch
2 times, most recently
from
November 15, 2026 17:17
e686b56 to
43daeba
Compare
The row killed the JS host as soon as the lab's toast showed. The JS host may still have been running lab code for messages sent before (a view for an adoption or a pushed read), and an end inside a plugin's code fails that plugin (review carbon-3): the lab failed with "its view or cleanup ended the JS host" and its last toast never came. With each lab view held 200 ms in the JS host, the row failed so every time. The row now settles first, so the JS host has run all it was sent.
a_claim_follows_the_pending_keys failed in lane run 20261114-220050 with "Plugin failed: p0b" on screen: one of the reader's calls was charged over the 100 ms a call may take, though the row checks reads, not the budget. Time on a run queue is not charged since flakes-7, but a loaded machine also stalls a call in other ways (memory reclaim, swap). With the reader's render held 120 ms once a key is pending, the row failed every time with the lane's screen. The module's harness gives its monitor a clock that does not move, as plugin_model's does: a call takes no time, and the budget keeps its own rows. One row's raised limit for its deliberate 200 ms call goes.
interop_with_a_typescript_service picked its ports by binding port 0 and closing it, and the TypeScript or Rust service bound them seconds later. Such a port is in the kernel's ephemeral range, which every port-0 listener and outgoing connection on the machine draws from, so it could be taken first: "Failed to start server. Is port N in use?" (the "spawn race" of an earlier gate). With 20,000 port-0 listeners cycling beside it, the row failed 3 of 3. Both rows that hand a port to a service (this one and opencode-service's interop row) now pick one below the ephemeral range, which only a process naming it takes, and never the same one twice in a process, as flakes-7 did for P-TUI's children. Under the same churn: 3 of 3 each.
Phase Pl of the rich-plugins plan (synthesis 4.2). A tree is admitted by its expanded cost before anything is built: its nodes, the rows the host builds at once, each node's text and a patch's hunks. The node that would cross a limit shows a placeholder, standing for the siblings after it, and the rest of the tree draws; a malformed tree is still refused whole. What the host holds for a plugin (its trees' nodes, its content, its decoded images) is charged to it and to the total, so no plugin spends another's share. Images are admitted by their header and decode on a worker with a native context of its own. The host's own work for a plugin's nodes is timed as its host time, beside its calls. A wake marks the plugin ready; its updates run in turn across plugins under the frame budget, the rest at the next paint, after the input that came first.
Each limit has a tree at it and one past it. The oracle is a twin TUI with every limit lifted that shows the tree the contract describes, compared cell by cell with styles; beside it, the placeholders, parses and decodes the host counted, and what it holds for the plugin and for all plugins. An image decoded on the worker equals what OpenTUI draws for the same bytes decoded in the frame.
Found by the flood model. A wake drained every ready plugin, so a plugin's wake ran another plugin's leftover updates early, which freed that plugin's mailbox early and changed what its thread's sends returned. A wake now drains only its own plugin; the round across plugins runs as the paint starts. The frame's spend was also keyed by addresses an activation or an app can reuse, and was forgotten when a plugin went idle; it is kept per activation for the frame, by an ID no other activation gets.
Two plugins whose updates cost a fixed time on the monitor's clock, which nothing else moves. Over each painted frame the 4.2 rule is checked on the plugins' own log: every update after a plugin's first started under its own and the total budget, mail left after a frame means a budget was spent, a key is handled before the updates of its turn, and while the total is not reached the second plugin sees what it sees in a twin run without the first plugin's sends.
The probe of plugin_limits.rs, in release on TestApp 200x58 with its frame check off, gave about 4 us a row to build a tree and lay it out the first time, 0.12 ms a patch hunk, 10 us a line of code (its first frame highlights it), 4 ms for a text of 1 MiB, and 12 ms for 20,000 nodes of a list's data. So a hunk counts 30 rows and a line of code two, and a tree may build 3,000 rows at once, under a 16.7 ms frame for every kind; a patch may have 100 hunks. Images of 2048x2048 took 28 ms to decode in the frame and take 0.6 ms of the UI thread from the worker. P1's gate probe lifts the limits to measure its 410-card scroll, and the deviation names what TS does not limit.
The frame budget of 4.4 is per plugin over its handlers, update, view and layout. The scheduler counted the updates it ran; it now reads what P4c's monitor timed of all the plugin's calls in the host's frame, P2's input handlers included, and of all plugins' calls. The flood model's key handler costs time on the monitor's clock, and its oracle counts it.
A panel beside a session and an overlay on it show the same tree past the node limit as a route: the placeholder, the rest as it is, the twin's frame, and the nodes the host holds for the plugin; on both carriers.
One tree at 3,000 rows, 20,000 nodes and 64 layout levels is adopted whole and its frame renders, so no plugin tree reaches OpenTUI's layout limits; one text more is that text's placeholder and the twin's frame. In a debug build the adoption of 64 levels needs more stack than a test thread's 2 MiB, so the row runs with the UI thread's 8 MiB.
Rows for a line of code as two rows, a list's item data that builds no rows, a keep that counts the nodes it keeps, a release that gives content back while the mount lives, an image one pixel row past its limit with room in its plugin's share, and a plugin that went idle keeping its spend for the frame. The round's rotation goes: no property needs it, and the round runs in the order the plugins became ready.
Review bigboi 1 and 7. OpenTUI's poll hands a wake before the key read with it, and the wake drained its plugin at once, so an update ran before that key. A wake now only marks its plugin ready and asks for one drain of its app as the next paint starts, after the whole batch of input; an app has one drain asked for at a time, held by a token the drain's animation owns, so wakes before a paint no longer stack callbacks and a dropped app's flag does not reach a new app at its address. The flood model replays the poll's order and counts drains a frame.
Review bigboi 8. A step handed over the next message before it looked at a panic report or a wake, so a thread that refilled each freed place held both back for as long as it sent. Each message now has its place; a report keeps the place it took, as does the first wake not yet handled, and a message put in after either waits until it is handled.
Review bigboi 2 and 6. Measuring a tree read every node's text in full before it checked the text limit, a handle's bytes once for each node that named it and again at each revision, so 64 nodes naming one handle past the limit took 27 ms before any was refused. A source past one node's text is now refused by its length unread, and a mount reads each handle's bytes once. Admission also took an added file for chunks by a count of lines with its headers and a looser test than the renderer's, so 2,999 added lines were charged as chunks and drawn whole; both now use opencode_ui::diff::added_lines.
Review bigboi 9. The image limit was a product of pixels, so a row of 2,049 pixels decoded; it is now 2,048 a side. A decode that failed kept what it reserved, so the next image had no room; and a mount that closed gave the reservation back while its worker still held the bytes. The decoded bytes are now a reservation the job holds, given back when the job ends unless its mount takes the pixels, and counted as the plugin's jobs; a test seam holds a plugin's workers before they decode.
…that fits Review bigboi 5. A mount kept the tree its plugin offered as its last, so a text past the limit stayed held in full though only its placeholder showed; it now keeps the tree it adopted, each node over a limit as its placeholder. A placeholder past the nodes or rows took its node's id, and a later keep of that id kept the placeholder though the node would fit; the tree records what each such placeholder stood for, and a keep of one that fits now refuses as unknown, which asks the plugin for a whole tree.
Review carbon 4.1 to 4.3. The close a paint ran as it started ended the frame then open, so a key's time and the next update's fell in two frames and a plugin at 1.1 ms a frame was never slow; a close now ends only the frames before, and asks for the paint after while an open frame is over the budget. A paint's layout and canvas draws run after OpenTUI counted its frame up, so they count in the frame the paint started in. A wake is now taken by the drain rather than as it reaches the UI thread, so sends and replaces between two paints post one wake. The served plugin goes last after a drain again, so two plugins that the total binds share it. The scheduler counts updates a drain, which runs once a paint, and has no timing of its own beside the monitor's.
Review carbon 1. A keep of a node a placeholder stood for counted as the one-node placeholder, so a sibling past the limit beside it showed a second placeholder; a keep of a node the placeholder's run absorbed, or one inside a placeholder, was unknown, so every revision asked for a whole tree; a kept box that was opened stayed cut once there was room; and a keep counted no rows, so kept subtrees could build past the rows. The tree now records, for each id, the subtree a placeholder stood for, the whole subtree of a node it opened, and the rows each subtree built. A keep costs what it stands for: one that fits whole where the tree holds no widget for it asks for a whole tree, one that does not joins its run's one placeholder, and a kept subtree counts its rows.
deny.toml allows the licences the tree needs today, each with the crates that need it, and LGPL-2.1-or-later for opentui-sys alone. Sources are crates.io, OpenTUI's pinned git and the tag-pinned HCL grammar; duplicate versions warn. check:deny runs the offline checks (licenses, bans, sources) with --frozen; check:advisories needs the RustSec database and so the network.
Guest::push charges a watched read's value to the plugin's content before it sends the snapshot. When the frame fits but the overflow has no room left, Scripts::refuse sends a failed read in its place, and the charge stayed: the plugin held, until it unwatched the read, the room of a value the JS host never got, which could refuse its other reads and content (bigboi's pipe sign-off, recheck). The refusal now gives the charge back through Guest::unpushed, so a read the overflow refuses holds nothing, as one past the frame already did. No other message to the JS host is charged before it is sent. a_read_the_overflow_refuses_holds_no_content stalls the JS host behind a backlog, pushes a read of 32,785 bytes that fits a frame and not the overflow, and once the queue drained checks the ledger and that a neighbouring read of the same size, which needs that room, is pushed. Without the change the ledger holds the unsent value.
Both clients armed the leader timer from App::on_key, but the keys reach the keymap through a capture handler that stops them, so on_key never ran and a pending leader sequence never expired. dialog::expire_leader now arms the timer from the keymap's pending sequence listener, as TS's registerTimedLeader does: each change that leaves a leader sequence pending restarts it, any other change cancels it, and it runs on the app's clock. TuiKeymap exposes leader_armed(), leader_timeout() and expire_leader(generation), the shape of OpenTUI's coming TimedLeader API, in place of leader_deadline() and expire_leader(Instant). A row per client on the manual clock and two P-PTY scenarios, with the default and a configured leader.timeout, cover it.
Approving a project's TypeScript plugin hashed its whole tree on the UI thread to identify it again, and the first load after the approval then copied and hashed the tree there a second time to stage it. With a large node_modules the click stalled for seconds. A stage that found other bytes also hashed the tree again on the UI thread. host::decide now hashes a tree on a blocking thread and records the decision once the hash ends, still only when that hash is the build the user was shown. A library is still identified at once. The tree walker makes the staged copy on its own thread too; the plugin is starting until the copy exists. A stage that fails holds the plugin back with its error and asks the walker for a full hash that ignores the stamp and the thread's cached hash, so the new build is asked about once it ends. The guarantee holds: the decision names the hash taken after the click, and the copy the JS host imports is checked against the approved hash as it is written.
A plugin that loads or reloads remounts the route, which mounts a new composer, and the open `/` or `@` list closed with the old one. TS keeps the list open while a plugin loads, and keeps its selection until the search changes. A remount of the same route now hands the open list's mode, trigger, selection and first row to the new composer, which reopens it over the restored text. Until the new composer is laid out, the list takes the height the old one had at the same place. Dialogs were already kept. P.8/select-search no longer waits for its plugin before it types: `/find` is typed at once, so the plugin loads while the list is open.
host::decide now answers a TypeScript plugin's approval once its tree is hashed off the UI thread, so js-npm's row for a project-local server part waits for that answer instead of reading it at once. The row also checks that the UI thread reads none of the part's files while it is approved and staged, as for a project's plugin directory.
Reopening the composer's open list after a remount pushed the "autocomplete" keymap mode again, above "modal" when a dialog was open over the list. The dialog then lost Escape, the arrows and Enter, and Ctrl+C fell through to app.exit. Toggling a plugin in /plugins remounts the route, so this happened with the JS host off too. The reopened list also dropped its file or directory search, searched again, and lost its selection. The old list now hands its entry on the mode stack to the new one, so the stack stays as it was before the remount and a dialog over the list keeps its keys. The list reopens only when the new view's focus target is the new composer; otherwise the entry goes after the event. The last search's results and the search they answer are carried too, unless a search was still on its way.
host::decide hashes a TypeScript plugin's tree off the UI thread before it records the answer, so two answers on one build can finish in either order. An Approve still being hashed could then overwrite a later Decline and start the declined plugin, and a second Approve reported a changed build that had not changed. The loader counts each answer on a target. When a hash ends, an answer the user has since answered again is dropped silently: it records nothing and its callback does not run. A failed copy of an approved tree also kept its error for later questions. Trees::rewalk now drops it, and a copy that failed before a walk found other files is made again, so a tree that is back as it was approved loads.
Since #64022 the server answers a handler defect with a 500 whose body is the protocol's UnknownError: a message and a log ref. The TS TUI's errorMessage shows only the message. Rust toasts showed the declared error's Display, which puts the tag in front, so a failed prompt, command, shell, revert or session read said "UnknownError: ...". These toasts now use tui_message. P-APP C.13/command-defect records the TS toast.
When message.list fails as a session opens, TS's createSessionRows drops the error and the session opens with an empty transcript. prependHistory drops an older page's failure the same way. In both cases the user gets no sign that the transcript did not load. Under O-89 Rust keeps its toast for these failures and records the difference in O89-transcript-read-toast. These toasts, and the session.first toast that TS also shows, used the error's Display, which puts the tag in front. They now show the message alone, as toast.error does. P-APP E.6a/history-failed drives the deviation: TS's empty transcript, and Rust's equal cells apart from the toast's box. A navigate row covers the session open, page up, the previous-message walk and session.first.
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.
See https://github.com/simonklee/opencode-native-preview