Repository navigation
refactor: untangle the codebase and refresh its dependencies - #108
Merged
Merged
Conversation
Paste and browser fill each had a 1 MiB constant, a CLI reader and their own checks, and the fill rule let a path through over the socket. Domain now owns TEXT_MAX and one check for both, and the CLI reads --file through one helper.
valid_theme_choice accepted -a.b-/x, whose plugin half is no valid plugin id. It now uses PluginId::valid, and the two empty-or-control checks in check() share one helper.
Three callers had to call before_connect, build the name, then connect, in that order. Client::open does all three.
String building in the CLI uses write! instead of spelled-out write_fmt, the path warm-up spawns user_path directly, and the two sends and kills that may find their peer gone say so.
install now sends UiJob::Op and UiJob::Surface to their own paths, so the driver functions take UiOp directly and no longer re-check the job kind.
… each Adds tests for each browser call, scroll and ref checks, the status tones and a state constructor called without a receiver.
Kimi skills now follow the same folder override as Kimi sessions.
Ids that must match in two places (answer and header focus, body ids, sidebar row prefixes, the thread and project key contexts, the archived list test, the quit sentence) now come from one function or constant.
The Dock badge, the next-thread jump and the event refresh filter each had their own copy of the rule. Attention now owns needs_you and refreshes.
The click sent the thread through the plugin host, so a click made before the host started did nothing. The window now selects the thread itself. PluginHostEvent had one variant, so the plugin host no longer emits it and the type is gone.
# Conflicts: # crates/ui/src/kagan/settings/installed.rs
# Conflicts: # AGENTS.md # Cargo.toml # assets/THIRD-PARTY-NOTICES.txt # docs/decisions.md
Upstream gpui-kit needs 1.99. Clippy 1.99 adds assert_is_empty, allowed: its fix reads worse than assert!(x.is_empty()).
gpui-kit 52e47a4 (95 upstream commits), gpui-fast 9501036 (74 upstream commits, our 4 Windows crash fixes carried onto upstream's device recovery), wry already current. The ui registry keys a window by its id, since gpui 0.3.12 changed what its text system pointer can tell apart.
The authorizer denies BEGIN, COMMIT, ROLLBACK, SAVEPOINT and their variants in plugin statements. Only COMMIT was tested, so removing the guard left the rest unpinned. The new tests fail when the guard is removed: a plugin ROLLBACK then leaves later statements committed, and a migration can commit its own COMMIT.
The line waited 1.5 seconds after the last key, so a message the person paused in the middle of could be sent with the line stuck to it. Text that does not end in Enter now holds lines for 30 seconds after the last key. Enter drops the hold back to the typing quiet, so a sent message does not delay lines. The test fails on the old 1.5 second hold.
A parent that waited on its child was then typed the child's end again once its own turn ended. A wait or wait-event that returns the child's end now drops the line queued for that end. The cost: the request does not name the waiting thread, so a wait from any thread drops the parent's line for that child. Tests fail when the drop is removed.
The window and core each held a copy of the 1.5 second typing quiet, and only a sentence in decision 201 linked them. Core now owns TYPING_QUIET and the window uses it.
The line put the child's title between quotes into a shell parent as typed input, so a title with quotes or $(...) changed what the parent ran. The line now names the child by id and says where to read it. The test fails on the old line.
Every sweep ran a delete of archived screens once any thread was archived past the grace, and archived threads stay archived, so the delete ran every second in a normal workspace. The sweep now deletes only when it released an ended screen, and app start runs one delete for rows no screen in memory owns. The test fails when the delete runs on every sweep.
The layout save dispatched its preference write and detached the result, so a failure left no trace. It now goes through the logged dispatch that the other controls use. No test: the logged line goes to stderr, and a test would have to capture it.
The rule said tests use an in-memory database, but the schema and reopen tests use a file in a temp folder, and they must.
… names its limit test-env-check only read files named as tests, so a #[cfg(test)] module inside a product file was not checked. It now scans from that line to the end of the file. The rule also says a read through clap env or a product helper is checked in review, not by the script.
…ows its limit Three private items had doc comments, which the rule bans. The cache test copied the limit as 64; it now uses MAX_ENTRIES, so the two cannot drift.
The help text said the parent is not told when the child waits. The line is sent when the child asks a question, so the help now says that, and the CLI reference is regenerated to match.
tell() created an empty run for a parent that had none, and kept the entry after the line was dropped. Now a line is queued only for a parent whose program is running. The test removes the parent's run and fails on the old code.
Entries 193, 194 and 198 to 201 had the number alone in bold, so a reader could not scan the titles. Each heading is now **N. Title.** with the entry's first sentence as the title.
The startup delete sat at the end of refresh, which every changed sweep and every thread start also calls, so it ran again after the first load. It now runs once in resume, after the first refresh. The test starts another thread, which refreshes, and fails when the delete runs there.
… Enter The comment said child lines wait for the typing quiet. Since the draft hold, that is only true after Enter.
aorumbayev
added a commit
that referenced
this pull request
Nov 10, 2026
…109) Three loose ends from the untangle (#108). - **Resume test:** a test-only `Workspace::open_with` runs setup before resume, so a killed resume pass is now tested (`a_killed_resume_pass_brings_back_a_thread_that_exited_cleanly`, shown to fail without the keep block). The four restart tests use the homes map instead of process-wide env vars, and a resume-order flake (equal `created_at` under the test clock) is fixed. - **Screenshots off the main thread:** `kg ui screenshot` reads the window id on the window's thread and runs the capture on the background executor, on macOS and Windows. - **One "empty counts as unset" helper** in `kg`. Skipped: "sidebar rows built twice per frame" was wrong; the second build runs only on keyboard navigation, not in render. Checked: fmt, clippy, 1780 tests, all repo checks, macOS smoke. **Windows** capture compiles only in CI.
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.
Untangles the workspace so pieces that change together sit together, refreshes the forks and dependencies, and reworks four parts of the window that confused people.
What changed
Untangle (no behaviour change except the fixes below)
git:source prefix, the typing quiet, preview image caps, agent program names.ThreadOpmatched once.ThreadOpvalues; host modules registered from tables; the plugin folder layout owned by core.Kaganstruct split into feature groups; one thread menu for the title bar and the row; one dispatch-then-report helper; one front-window shell.kg_processowns the Unix tree kill; socket-only rules live indispatch_for; the socket is aWorkspace::openparameter; interaction options say which one is safe and which destructive; the keychain belongs to plugins;kg uishows the web panel hint; plugins own the facts core used to parse.Bugs fixed (each with a test that failed before)
KG_DATA_DIRorHOMEwas treated as set.Window
kg window toggle-activity-log); plugin status items can run their own command (decisions 196, 197).New: a child tells its parent (decision 201). A child started with
--parent-thread-idtypes one line into the parent's program when its turn ends, it asks the person, exits or fails. It waits while the parent is busy or the person has an unsent draft.kg thread run --quietturns it off.Rules and docs
AGENTS.mdorder of truth: code and tests, then enforced rules, thendocs/. Per-crateAGENTS.mdfor store, domain, ui, plugins and kg.scripts/decisions-check.sh,scripts/test-env-check.sh.allow_attributes_without_reason,undocumented_unsafe_blocks.assert_is_empty(new in clippy 1.99) is allowed: its fix reads worse.Performance and safety
KG_*or the person's agent folders.Dependencies
52e47a4). gpui-fast fork: 74 upstream commits (v0.1.14) merged, our four Windows crash fixes carried onto upstream's device recovery (9501036). wry already current.cargo update.Checked
fmt, clippy
-D warnings, 1779 tests, size budget, crate boundaries, glossary, view colors, decisions and test-env checks, pre-push hook test; CI on Linux, macOS and Windows; macOS smoke test.Needs a person
seq 1 5000with the VSCodium panel open, open the activity log, screenshot; repeat withGPUI_SCROLL_LAYERS=0. If either clears it, the bug is in gpui-fast.workspace/recovery.rs,resume_programs): kept because a killed resume can leave a thread Idle; its mutant stays alive until a test-onlyWorkspace::openhook exists.ui_driver.rs) was checked by reading only.