mirror of
https://github.com/zeronsh/comet.git
synced 2026-11-18 18:56:11 +00:00
314 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4ec5b50c86 |
Providers: keys read once, by name or last four; provider marks; Hermes env keys
- A key row says its last four exactly once: named, "Work" over
"OpenRouter · API key"; unnamed, "API key ···a1b2" over "OpenRouter".
The name, when set, is kept apart (display_name); the title is derived
otherwise. Rename opens empty for an unnamed key and says which key.
- Hermes keys read the same; one seeded from an environment variable is
never titled by it ("API key ···a1b2" over "OpenRouter · from
environment"), and Hermes' own "api-key-N" labels count as unnamed.
- A key row's face is its provider's mark in the add rows' round well;
logins keep their avatars. The add dialog's name field: "Name
(optional)".
- Test servers ignore the `HEAD /` probes a preview scan in the test
process sends to every local listener: the cause of the occasional
extra hit in the GHES, spent-Claude and Pi key tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
3d07f58d60 |
Providers: API keys, Claude for Pi, cards like Claude Code's, Hermes fixes
Per-provider agents (Pi, OpenCode, Hermes) now look and act like every
other agent's card, take API keys in the app, and behave across devices.
Card: the same rows, rules and "In use" as Claude Code's and Codex's — a
provider's accounts together, each provider with its own one in use, the
plan line saying whose ("ChatGPT Plus", "OpenRouter · API key ···a1b2") —
and every add row at the foot (Add ChatGPT / Claude / GitHub Copilot
account, Add API key). No section chrome, no CLI hints. "Switch to this
account" only on a switchable row not in use; a refused switch says why
in a toast instead of doing nothing.
API keys: "Add API key" opens a dialog (provider select with each
provider's mark, masked key field with its placeholder shape shown plain,
optional name, Save disabled until typed, spinner and locked inputs while
the provider checks the key, the provider's refusal under the field).
Stored as each agent's CLI stores it: Pi's auth.json api_key entry,
OpenCode 1.x's api entry (OpenCode 2.x keeps keys in its own database:
refused with what to do, and a warning on the list), Hermes through
`hermes auth add <provider> --type api-key` with the key on stdin in a
session without a terminal. Keys are named (default "<Provider>
···<last4>", renamable from the row's menu; a name holding any of the key
is refused). The key is never logged, never in an error or the snapshot,
never on argv or in a child's environment, files 0600, and
AddAgentApiKey is local IPC only (refused, never forwarded, when it names
another device; refused by the relay host if a peer sends one).
Claude for Pi: Pi's own Claude Pro/Max sign-in, saved as pi saves it, a
fresh grant, swapped under pi's lock; a switch keeps a refresh the agent
made since the last list (single-use refresh tokens). OpenCode has no
Claude sign-in (verified in 2.1.2): refused with the API-key alternative.
Hermes: lists only pool entries Hermes itself uses (its
_pool_entry_is_explicit: device_code, loopback_pkce, hermes_pkce,
manual[:*], env:<VAR> while the variable holds a key) — a borrowed
gh_cli Copilot token is no longer offered.
Also: provider marks (one mono set), Select options with marks, Dialog
confirm `disabled`, TextField draws a password's placeholder unmasked,
Groq/Mistral dropped from key providers (no marks in the set).
Tests: engine agent_accounts 118 (keys stored/refused/never shown or
logged/stdin-only/0600, OpenCode 2.x refusal, names and rename, two keys
one provider, Pi Claude local and for another device, rotation kept,
Hermes explicit-only); device_routing remote per-provider list/switch,
provider refusal routed, remote key refused with no relay frame and no
file holding it; rpc routing asserts; app Rust and UI tests updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
f29c197e2d | Merge remote-tracking branch 'origin/main' into zeron/main-catches-up | ||
|
|
a2115820ae |
Tool results: fill the image preview fields in main's new ToolResult events
Main added ToolResult initializers (ReadToolOutput tests in tool_output.rs and e2e, the mock harness's long-running commands, steer_now) after this branch last merged it. They lacked preview_paths and image_payloads, so zeron-engine's lib tests did not compile. |
||
|
|
4e1efa5393 |
Merge remote-tracking branch 'upstream/main' into pr1103-fix | ||
|
|
d071ed2dbb |
engine: a message from another chat never stops the agent's running command
Since a steer started stopping an open tool call in place (
|
||
|
|
40e79949c3 |
A terminal's writes reach it in the order they were sent
The RPC server ran each call on a task of its own, and tasks spawned back
to back start in no set order: tokio runs the newest first (its LIFO
slot). Two WriteTerminal calls in a row reached the PTY swapped. zgx's
terminal (Ghostty on macOS) answers a program's queries through the
bridge, each answer its own write: termenv (gh, glamour) asks for the
background (OSC 11), then the cursor (CSI 6n), took the cursor report
first as "no colour" and stopped reading, and gh's prompt read the colour
answer after it as typed keys ("unexpected escape sequence from
terminal: ['\x1b' ']']"), the cursor reports left in the shell (`;22R`).
Keys typed or pasted fast went out of order the same way, and a remote
viewer's numbered input lost the older of two (write_sequenced took it
for a replay).
A terminal's WriteTerminal and ResizeTerminal calls now run one after
another, in the order the connection sent them, on a lane of their own:
one per terminal, so a write that blocks (a paste into a program that
doesn't read) holds back no other terminal on the connection. A call's
answer is sent beside its lane, so a client slow to read answers doesn't
hold the next write back. When the connection ends, input already sent
still goes in; every other call is aborted as before.
tests/terminal_query_order.rs (unix; the probe is Perl): over the
engine's own dispatch, a program in the PTY asks as termenv does, 300
times, and a viewer answers as Ghostty does (two writes, at once).
Before: 284 of 300 read the cursor first (298 in an earlier run); after:
300 of 300 in order, the colour's answer in 2.64 ms median, 4.29 ms p99.
rpc's tests: two terminals' interleaved writes and resizes reach the
service each in order, a stuck terminal holds back no other, and input
sent before the connection ends goes in, in order (all three fail on
the base).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
|
||
|
|
1a7dc2e49c |
engine: a shut-down engine is freed (two holds kept its whole graph alive)
local_first's online_runtime_shutdown_stops_edge_workers_and_retires_the_graph
failed every time ("engine graph still reachable after shutdown + drop").
CI never ran it (scripts/ci/test-core.sh lists the engine tests it runs).
After shutdown + drop the doc host stayed at 2 strong references for good;
tracking every DocHost clone named both:
- The version-change hook (zeron_update::set_before_restart,
|
||
|
|
003b4feb44 |
engine tests: every harness whose boot revives a turn says it serves no IPC port
Same gap as message_queue's (
|
||
|
|
fd3bb08c1b |
engine tests: cloud_killed_turn compiles again (RunEnvironment::prepare takes the chat)
`RunEnvironment::prepare` gained `chat_id: Option<&str>` (
|
||
|
|
e6b959540b |
engine tests: a send reaches the agent while the publish is held
send_to_delivered_stays_flat_as_the_chat_grows compared wall-clock send times in a 3,000-entry chat with a new one and failed under CI load (4/10 under load locally, before and after beta.7's changes). It guards |
||
|
|
b6b79ab398 |
engine tests: say the test engine serves no IPC port, as boot does
message_queue's restart test failed in CI ("timed out waiting for the
interrupted opening turn to be picked back up"). The engine was fine: a
turn revived on boot waits in `ipc_port_ready` until the boot says it
serves a port or none (deferred.rs always says one). The test engine said
neither, so every revival waited out the 10 s limit, racing the test's
own 10 s wait. Logs: resume at boot + 10.004 s when it passed, +10.009 s
when it failed.
assemble_at now calls `set_no_ipc_port()`. Restart test: 1-4/20 failed
alone, 0-2/10 under load before; 0/20 alone, 0/20 under 10 busy cores
after, and it runs in 9.4 s instead of 19 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
|
||
|
|
9290078c6d |
Deleting a chat ends its run, and takes its children with it
A deleted chat's agent (claude --print and its MCP servers, ~550 MB on staging) stayed warm under the engine until the 30-minute idle reaper. The sessions engine now follows the chat list: when a chat's row goes, by any path (Delete here or on another device, a Cloud parent's children, a deleted project's sweep, voice), its run ends through `terminate`, the Stop's teardown. Archiving keeps the run. A deleted chat stays deleted: no claim, no status row and no dispatch for a tombstoned chat, so a run ended mid-turn can't bring the row back and a queued message can't start a new agent. DeleteChat also deletes the chat's children on computers (subagents, side chats) and theirs in turn; a computer's chat keeps its Cloud delegates, as before. "Delete session?" says what goes with it, as the host counts it (archived ones too); with nothing, it reads as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
562c10ab6f |
Merge remote-tracking branch 'origin/zeron/zgx' into zeron/big-chat-lag
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
7a062eebd2 |
Registry: a rejoin beats only for a host still beating; steady beats don't republish
Review of
|
||
|
|
df4eecfe04 |
Engine: this device's own lastSeenAt keeps moving; the same editor gets its queue lease back
Presence: the registry room never echoes a device's beat back to its sender, so the engine's own device row only took a lastSeenAt from a rejoin's hello. After the 03:55 reset on work-laptop it froze there while the heartbeat kept going. RegistryClient now keeps the beat it last sent on a live session (own_presence) and the engine folds it into its own row. Every (re)join also beats at once, so peers see the device live again right after a reset instead of up to 15 s later. Queue edit: begin_queued_message_edit refused any unexpired lease, even one held by the same device and window asking again (its Acquired reply lost to a dropped app socket, or the chat reopened). The app said "being edited on another device" for up to a minute. The same editor now takes its own lease over; any other window or device is still locked out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
6248f09823 |
Tests: own lastSeenAt after every socket drops; same editor re-asking for its queue lease
The mock registry room now matches the DO: a presence beat goes to every socket except its sender, and drop_all_connections() cuts every socket at once (the 2026-11-11 03:55 reset). Both tests fail on this commit; the fix follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
c1168b6bfc |
engine: a send is taken at once, never behind the open chat's publish
The chat's change task awaited the transcript watch's publish before it drained commands and the queue, so a send's command waited for a long chat's publish (and the next, and the next while a reply streamed). The publish now runs on the blocking pool beside the drains; the next pass waits for it. Test (message_queue): send → the agent has it, in a watched chat, new vs 3,000 entries of 12 parts: 17 ms vs 33 ms. With beta.5's publish (whole read, before the drain): 145 ms, and it fails. With only this change and the whole read: 36 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
e1525b286a |
Zeron MCP: device_stats reads a device's machine stats, here or on another of the account's devices
A new DeviceStats engine RPC (OS, CPU, memory, storage, GPU, load,
battery, Zeron version; every field optional) and an MCP device_stats
{device?} tool. Another device answers through its relay within 5 s,
or the error says it's offline (last seen), too old, or not one of
this account's devices. sysinfo (already in the tree) with only its
system and disk parts; reports cached for 5 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
|
||
|
|
4e53fd831b |
Merge origin/zeron/zgx into zeron/settings-devices-projects
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
91d8a0104d |
zgx: Settings → Devices removes a device; Settings → Projects, new
Devices: each row's ⋯ renames it in place (Enter saves, Escape cancels, nothing moves) and removes another device from the account after a confirm that says its sessions and projects stay. Never this device, never one online now (its engine is running, maybe with live sessions), never one of Cloud's. Loading, empty and no-engine states. Projects (new): each device's projects under it, this one first, with their tile, sessions and folder; found by name or folder. A row renames in place, opens Edit project from its tile or ⋯ (name, emoji, image, repository logo, colour), shows this device's folder in Finder, and removes the project from Zeron after a confirm that says its folder and files stay; its running sessions are stopped first, wherever they run. Loading, empty, no-match and no-engine states. Underneath: a `delete_device` registry write (a tombstone, revived by the device's own next boot), the engine's `removeDevice` Mutate op with its refusals, `sessions.remove_device` in the host (refused in previews), and an edge without image uploads (production) saying so plainly in Edit project, emoji and colour still saving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
58dfcb2c94 |
Merge zeron/zgx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8ea7bf8c1b |
Plugins can run a chat on a saved account (accounts.pin) and decide it at its first run (#1290)
* Bump the workspace to 0.2.137 for the beta A beta is of the next release: 0.2.136-beta.N sorts older than stable 0.2.136, and zgx-beta.yml refuses it. One commit, so the number is easy to change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: by-hand runs of different versions don't queue behind each other Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx on Windows: the build fix from #1212 Only what apps/zgx needs to compile there: a visual's thread CPU time on Windows, a Unix-only symlink test behind cfg(unix), and windows-sys. The rest of #1212 stays on its own branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx on Windows: the panel's browser tabs as WebView2 pages zgx-desktop's webview2 feature, from zgx/windows-panel. Without it the Windows beta's browser tabs are placeholders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * The beta channel on Windows and the Linux desktop A beta build there now follows update-channel.json, so it updates from releases/beta and can go back to Stable; stable builds and every engine stay on stable, and the macOS floor stays macOS's. On Linux a beta's directory isn't named as a version, or the shipped engine reads it as newer and restarts into itself whenever it's idle. On Windows a beta updates from its package, its scripts and stable's zeron.exe as its engine under beta\<version>; stable's single-exe update is unchanged. zgx finds its scripts beside the binary, and the Windows beta has a window subsystem and Zeron's icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: Linux and Windows Linux (x86_64, aarch64) and Windows (x86_64) beside macOS: the zgx interface and the latest stable's own engine, by checksum, with stable's artifact names but the beta's version. Windows has no standalone .exe, which can't run alone. Every key stays under beta/, the manifest last, listing every platform's files. A run by hand can pick platforms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zeron update names a beta's real directory Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx on Windows: the webview2 line at the new zgx pin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * Plugins: a host named exactly asks, whatever it reads as (the rebind hole) A plugin allowed any public host could update to name `rebind.example.com`, pointed at 127.0.0.1. Nothing asked (it read as public) and the window didn't flag it, yet a named host reaches a private address it resolves to. `127.1` and `0x7f.1` went the same way through the app's transport. - `net::risky`: a name ending in a number reads as local, so it's flagged and asks. - `capability::diff` (crates/engine): over an any-public grant, a newly named exact host asks. `*.` names still don't: they never reach a private address. This reverses "narrowing to named hosts doesn't ask" for exact names. - The permission window, under exact names that don't read as local: "A named host can be on this computer or your network." en and zh-Hans. Names like `.ts.net` and split DNS keep working once named and allowed, with no manifest change. A plugin allowed as it is isn't asked again. Nothing here works out where a name points: DNS can change after consent, so the person's yes is what allows it, and the new line is what makes that yes honest. Engine change: ships in a stable release before a beta. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: a draft takes the files, then it's published Releases here are immutable once published, and the release action publishes a prerelease before uploading unless it's a draft: beta-v0.2.137-beta.7 was published empty and its uploads refused. So the draft takes the files, and the next step publishes it as a prerelease that's never the latest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * Change requests: start Git and gh off the runtime workers SystemProcessRunner spawned on the calling task's worker thread. On Windows the standard library creates every process behind one lock, and CreateProcessW sometimes takes over half a second. PR watches start Git several times a second, so the queue for that lock grew until all 16 runtime workers waited in it. The engine then answered nothing for seconds at a time: viewport sockets dropped, sync probes missed their deadlines, and a stop or a new message waited behind the queue. Spawn on the blocking pool so a slow launch holds a blocking thread, not a worker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Change requests: share one Git inspection per watched path Every PR watch inspected its checkout on its own every 15 s, five to eight Git processes each time. A project with ten chats ran ten identical inspections. Only the provider query was shared. Watches on one path now join an inspection started less than one poll interval ago. The run is a shared future rather than a lock, so a watch that stops being polled mid-inspection does not hold up the others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * zgx beta: the Windows zgx-desktop dependency at the same pin This branch names zgx-desktop again under cfg(windows), so the pin has to move here too: two revs fail every platform when the manifest is parsed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: the Windows zgx-desktop dependency at the same pin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: the Windows zgx-desktop dependency at the same pin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: the Windows zgx-desktop dependency at the same pin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: the engine comes from the same commit A beta tests what's next, the engine too. It compiles the engine from its own commit on every platform, rather than downloading the latest stable release's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: its engine carries the beta's version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: the Windows zgx-desktop dependency at the same pin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: the Windows zgx-desktop dependency at the same pin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: 0.2.138, the version after stable 0.2.137 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * zgx beta: the Windows zgx-desktop dependency at the same pin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> * Add iOS App Store link to landing page * edge: a chat2 checkpoint past one request's most can come in parts The edge takes at most 32 MiB of checkpoint in one request; a long chat's snapshot is past that (35 and 39 MB), so its host's every post was refused 413 and the room kept no fresh checkpoint. `POST /chat2/{id}/checkpoint-part?offset=` appends a piece (at most 8 MiB) to the room's staged checkpoint, kept as the blob store's chunk rows; `POST /checkpoint?seqCovered=&staged=<size>` commits it by renaming those rows, with the same guards (and `incomplete` when it isn't all there). GET /checkpoint streams it a row at a time (Range as before), and the nightly backup writes a large one as an object of its own, streamed. A single POST, its 32 MiB cap and its 413 are as they were; engines send parts once they run the change (zeron/zgx |
||
|
|
51b0e1dc43 |
Merge zeron/zgx into the Cloud, relay and GitHub work
Conflicts resolved: - Engine checkpoints: zgx's upload in parts now carries the relay layer's atFloor/heal flags and hands the edge's refusal back to the relay state. The engine's own size cap follows the room's (256 MB in parts), so a long chat's checkpoint isn't held back before it's sent. - Attachments: zgx's local copies of another device's uploads, rewritten with the app-capture attribute escaping. - zgx app: zgx's composer, mention sections, link chips and remote harness retries, with the Cloud machine notices, held messages and turn states on top; v2 template base re-recorded. - Linux packaging: zgx's beta packaging, keeping the fat-LTO engine build. - apps/zgx Cargo pins: zgx's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e9a956ecb1 |
Engine: approve and install plugins on your other devices
Beta users couldn't install a plugin on another of their devices from Settings → Plugins: since R6 (#1139) a peer was refused ReviewPlugin (local_only) and DecidePlugin {allow: true} (peer_refused) at both ends, and ReviewPlugin wasn't forwardable, so the sending engine minted a review for its own plugin list ("There's no plugin …"). A file couldn't be sent at all. Now a verified peer (the edge's fromDevice, same account) may mint a plugin review and allow with it; a review is bound to who minted it (reviews::Origin), so B's review for A is good only to A over the link, never to B's own app, an unverified dial or an agent. The sending engine carries reviews, allows and files only for its own app (zeron_rpc::app_forward_only), never an agent's token. A .zeron-plugin file goes over in 384 KiB pieces (StagePluginPackage, then InstallPlugin {upload}), since relay requests aren't chunked. Templates' consent and signing stay local. An older engine's refusal is said as the version it needs (REMOTE_APPROVALS_SINCE). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
04e09f8938 |
Merge main into zeron/cloud-relay-v3
Main's #1307 reads chats in windows and stops reading before a send, which replaces most of this branch's handling of sleeping hosts. Kept: a read of a chat falls back to this engine's replica when its host can't answer, now as window_of. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d1dd3910bc |
Merge remote-tracking branch 'origin/main' into HEAD
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com> |
||
|
|
68c7ea286c |
Chats reach long chats on other devices (#1307)
A long transcript was one RPC message across the device relay. Past 16 MiB the Durable Object's single frame hit tungstenite's default frame cap in the reader, ending the whole peer link; past 32 MiB workerd closed the host's socket, ending every client's. Each read of such a chat from another device failed with "WatchDocMessages: stream ended before the transcript arrived", and send_message read the transcript before delivering, so sends failed too. - Relay: clients that reassemble say so in the RPC stream id; hosts send them large replies in 512 KiB pieces. Older clients get an error for that request instead of a frame that ends their link. Relay dials take frames up to the local socket's cap, so older hosts' big frames arrive. - WatchDocMessages takes a window (limit, offset, after): frames carry only the slice and its facts. Older hosts ignore it and the reader slices. - send_message delivers first. The turn's marker is the sent message's own id, so nothing about the transcript can hold up or undo a send. It no longer needs the host's harness catalog when the chat has a harness. - read_chat, get_chat, respond_to_input and waits ask for windows, and waits follow deltas rather than re-reading. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
69e03cbc83 |
engine: the recovery tests serve a port; an engine serving none says so
`run_recovery`'s engine never recorded a port, so each turn it revived
waited out the ten seconds that file's own `wait_for` gives up at, and
seven of its tests failed. Its helpers now record one right after
assembly, as a serving engine does and `restart_resume`'s already do.
An engine that knows it serves no port (the app lost the IPC bind) now
says so with `set_no_ipc_port`, which rings the same wait: a turn it
revives goes on at once without Zeron tools instead of after ten
seconds. A unit test sees the wait end as it is said, and not start
once it has been.
(cherry picked from commit
|
||
|
|
a18477452b |
engine: the revived turn's port wait, tested; its bearer seen with the port
A serving engine records its port right after assembly, so the
restart tests' engine does too: unserved, every turn they revive would
wait out the ten seconds their own wait gives up at. A new test revives
a crashed turn into an engine not yet serving, and sees it hold until the
port is recorded and go out with Zeron's MCP server; a unit test times
`ipc_port_ready` on a paused clock.
The port is stored with Release and read with Acquire, so a revived run
that finds it already recorded also sees the token file recorded before.
(cherry picked from commit
|
||
|
|
2ef7e2b782 |
Merge zeron/zgx-cloud-machines
# Conflicts: # apps/zgx/ui/account/cloud.luau # apps/zgx/ui/screens/settings/cloud.luau # crates/engine/tests/cloud_rpc.rs |
||
|
|
70e86950b1 |
Merge zeron/github-multi-account
# Conflicts: # edge/src/cloud/cloud-account.ts # edge/test/workerd/cloud-delegates.workerd.test.ts |
||
|
|
960a21734b |
Merge zeron/cloud-attachments-r2
# Conflicts: # crates/client/src/live/mod.rs # crates/client/src/session/mod.rs # crates/client/tests/support/mock_edge.rs # crates/sync/src/store.rs # crates/ui/src/state.rs |
||
|
|
a21e2add2c | Merge zeron/cloud-fast-wake | ||
|
|
acfdd9a440 | Merge zeron/cloud-durable | ||
|
|
6095e58cb6 |
Merge main into zeron/cloud-attachments-r2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
accc4f044e |
Merge main into zeron/cloud-durable
Both sides added MCP tests at the same spot; both kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ac1700f2b6 |
engine: an attachment reaches the agent by the path on the device that runs it
A Windows user's agent was told to read C:\Users\ADMIN\…\uploads\
2fbd2b3b-image.png while it ran as HP MEDIA: an upload path made by
another engine (another device, or another Windows user's engine on the
same PC), which means nothing where the agent runs. The driver couldn't
inline the picture and the agent's own Reads failed.
The host now places every attachment itself, wherever the message came
from: a run, a queued row (drained, sent now or steered) and a steer.
A `pending://` ref resolves as before. A path that doesn't exist here
but names an upload (`{id8}-{name}`, in either separator) goes by this
device's own copy, which an upload to the host commits under the same
name. That covers the paths the prompt names too, and the read-back that
draws the message's chips. A path with no copy here goes as it was.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
12e5551938 |
Merge zeron/cloud-durable: faster dark detection, sends before a turn, store recovery
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3324f850f7 |
A damaged chat store is found, kept aside and rebuilt
On staging a Cloud machine's docs.sqlite3 came back from a sleep with pages from two moments. Every read of the chat failed, and the message sent next waited for good while the machine read ready. Three parts, on every engine: - Prevent: once the quiesce for a sleep is accepted, the engine writes its open docs into the store and folds the WAL into the database file (wal_checkpoint(TRUNCATE)); the shutdown does it again last. With the stop command's sync, the file the provider snapshots is the whole store, at rest. - Detect: every open runs PRAGMA quick_check first (integrity_check when a running engine asked for it). A store error that says the file is corrupt is noticed while running: a Cloud engine restarts at once to rebuild (nobody is there to do it, and a message would wait), others on their next start. - Recover: the damaged file is renamed aside (newest three kept, for diagnosis), a fresh store is made, and every readable row of every table is copied over, each table read forwards then backwards past the damage. The ledger comes across, so a handled command never runs twice; docs not readable come back from their rooms. The heartbeat says when it happened and the edge records it (store_recovered) and shows storeRecoveredAt. WAL with synchronous=NORMAL stays: it is crash-consistent as long as writes reach the disk in order, and after the checkpoint, a clean stop and the sync nothing is in flight when the snapshot is taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
dee83c3822 |
Hold a send only behind a turn an earlier send started
The previous commit held any run issued before the live turn started. Narrow it to the case it's for: the running turn is the latest message, started by a run issued no later than this one, and isn't this send's own. A row the host turns into a command, or a send delivered again, goes as before. Measured against the cloud attachment suite run alternately with and without the hold (12 runs each): 1 failure each, the same pre-existing row-timeout flake under load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6ab00cf5be |
A message sent before the running turn started is its own turn
Two messages sent to a sleeping Cloud machine reach it together: the first starts a turn, and the second, read a moment later, found that turn running and was steered into it. An agent that yields on a steer (Codex) then ended the first turn with an empty reply and answered only the second. Seen on staging in every two-sends-while-asleep cycle with Codex (3 of 3). A run issued before the live turn started can't be a steer: its sender never saw that turn. It now waits for the turn to end and runs as the next one, the way a send to a turn-boundary agent already does. A send during a turn the sender can see still steers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
db6066434f |
A machine stopped mid-turn is brought back within a minute
The edge counted a machine as gone 3 minutes after its last heartbeat, so a turn killed by a hard stop sat silent that long before boot recovery resumed it. The engine now beats every 15 s while a turn or background work runs (every 60 s otherwise), at once when work starts or stops, and says its cadence (everySecs). The edge counts a machine that says it beats fast as gone after three of those beats, never under 45 s; an older engine, or one at the idle pace, keeps 3 minutes. A machine already stopped is put to sleep without the quiesce and stop commands it can't answer, so its wake follows at once. A live engine judged dark by mistake still declines the sleep (quiesce answers busy), so a false alarm costs one command, not the turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5b3f50b3ce |
Offer Remove on the desktop, and fail a queued row whose file is gone
The desktop transcript now shows Remove beside Retry on a failed send, and beside "Sending..." while a send's files upload. It calls RemoveHeldSend and takes the message out of view at once. The lifecycle rule for stored files goes to 30 days, so a queued message on a machine asleep for weeks still finds its files. If one has aged out anyway, a Cloud machine past the 15-minute cap now takes the row out of its queue and leaves it as its sender's failed message, with a retry that uploads the files again. Before, the row waited for them forever. A phone keeps each file it sent through the store until that message is in the transcript, for queued rows as well as runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6e8b4c8a99 |
Keep every send until its person removes it
A failed send nobody retried was deleted after a week, and a send that couldn't
upload for a week stopped trying. Now the outbox never gives up on its own: it
backs off to every 15 minutes after a week, and a failed send stays until it's
retried or removed.
RemoveHeldSend {chatId, id} takes a send out of the outbox, failed or still
uploading. It never goes out after that, even mid-upload, and its stored copies
are deleted. On mobile, PendingSend.removable marks those rows and
SessionHandle::remove_send does the same.
Every try uploads all of a send's files again, so none ages out at the edge
while it's alive. A phone now keeps its copy until the message has run, so a
retry after expiry uploads it again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
a3f6c35262 |
Engine: check session heartbeats every 5 s so restamps stay 30 s apart
With the 15 s liveness tick a stamp left by the last streamed event could wait for the second tick past 25 s: the live test saw a live row go 39.9 s without a restamp, too close to shipped readers' 45 s gate. The tick now only checks every 5 s, and the activity projection checks on the same cadence, so a due row is stored within 30 s of the last. The live test reports rows moved instead of the room's in-memory counters, which reset whenever the idle object is evicted, and holds the live-row gap under 33 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
f295d210fb |
Engine: store session heartbeats only while a row can expire, and skip repeated host stamps
Measured on wrangler dev, a 60 s streaming turn pushed 14 registry rows and the session it parked pushed 8 more every 2 minutes, for 30 minutes. - A liveness touch restamps a session row only while it says something readers expire (a live status, subagents, background work, a wait), and at most every 25 s (quiet rows every 30 s, on the second 15 s tick). Shipped readers drop such a row after 45 s with no other signal, so this is as slow as they allow. A session parked idle is not touched at all. - Terminal activity leases refresh on the same cadence. - Harness session, source context (observedAt aside), branch, checkout, cwd and roomGen stamps push only fields whose value changed. The live test now also streams half its turn and stays quiet for the rest, and fails if a live session row ever goes 45 s without a restamp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d0a451a033 |
Engine: a wake restarts the clocks of messages that waited for their machine
A message that reached a Cloud chat's doc before its machine turned out unable to wake (a send to a sleeping machine whose wake was then refused as too small, or whose files had gone) kept the clock it was stamped with when written, and could expire while it waited on the person. When the person wakes the chat's machine (`CloudSessionWake`, with or without a size) or starts a fresh one (`CloudSessionRetry`), the engine first re-issues the chat's waiting runs and steers whose clock has run out, or would within an hour (the machine's boot): the same message, a new attempt with its clock starting now, the old one rejected as superseded, as the person's retry does. Exactly once: one re-issue per message, and a live attempt is never re-issued. The commands stay append-only. `retry_delivery` also counts a pending attempt past its expiry as dead now: it can't execute, and the retry is the consent to send it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ea2c29cccc |
RegistryRoom: count the rows it writes, and a live test that measures them
/stats gains writesSinceStart: the billed rows (index entries and alarms included) the object wrote since it started, counted from each statement's rowsWritten. The live test runs a streaming turn and a parked session between two engines on wrangler dev and reports pushes, rows and fields per phase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
fe0f4f2641 |
zgx Cloud: say a dead machine's state, list Cloud models offline, hold sends it can't take
A reply whose host stopped reporting kept its working word ("Conjuring…")
for ever: zgx showed it for any reply still marked streaming, and a host that
dies never finishes one. It now shows only while the session's turn is heard
from and its host is there; otherwise the foot says why (its Cloud machine
asleep, failed, can't wake, files gone, or "Resuming" while it wakes; "can't
reach <computer>" for another computer gone quiet; "Interrupted"). This applies
to every host, not just Cloud (screens/chat/turn_state, pure).
A Cloud chat's model chip read "Choose…": the engine answered a Cloud target's
ListModels from this computer's own model discovery, which fails where Codex or
Claude Code isn't installed or signed in here. It now answers from the edge's
Cloud catalog (GET /cloud/{org}/models, as the phone reads it), the last list
kept on disk, then the local catalog. zgx keeps a Cloud chat's own agent listed
even when Cloud has no account for it, and the shared client knows a Cloud
device's agents without dialling its machine.
Sends to a machine that can't wake, or whose files are gone, are held: kept
across launches, shown in the deck's queue (only Remove), said in the alert's
line, and sent once a size or a fresh machine is picked. One held past an hour
doesn't go on its own: a deck alert says so and its row sends it. The engine's
WatchWaitingMessages (#1256; absent on older engines) feeds the same notice for
messages queued long ago that a waking machine will run, leaving out those past
their expiry, and its upload failures (the store's quota) show as an alert with
Try again.
Settings → Cloud's default machine is on the alert's grid (ds/grid, shared).
A sleeping machine's notice is quiet (a deck alert raising no pill of its own)
until there's something to send.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|