Skip to content

chore: sync fork with 280 upstream commits - #42677

Closed
radys-s wants to merge 282 commits into
pingdotgg:mainfrom
radys-s:tomas/sync-upstream-2026-11-25
Closed

radys-s wants to merge 282 commits into
pingdotgg:mainfrom
radys-s:tomas/sync-upstream-2026-11-25

Conversation

@radys-s

@radys-s radys-s commented Nov 25, 2026

Copy link
Copy Markdown

The fork was 280 commits behind upstream c5d6aa19de. Replay the fork changes onto that base, preserve fork-main ancestry with an -s ours merge, and fix integration issues in Auto launch validation, reset selection, and local-launch settlement.

Validation: serial check:changed upstream/main passes (1,789 tests across 62 files, typechecks for 43 affected packages, format, lint, knip, GraphQL and React Compiler); i18n and final documentation checks pass. An isolated seeded server applied migrations 103–117, completed orchestration recovery and answered HTTP 302; no live database writes, service restarts or deployment.

Independent read-only review: two rounds, approved; both findings fixed with failing-then-passing regressions. Details are in docs/progress.md. Full upstream-only suites remain for CI.

Needs the maintainer's agent-context-increase label: upstream increases MCP tool-list context by 205 bytes. Merge and deployment remain for the maintainer.

radys-s and others added 30 commits November 16, 2026 14:29
Auto Low, Medium and High existed only as custom models in the hub's settings, so a fork server on another machine (Tomáš's PC) showed no Auto at all. Every Claude provider now lists them as built-in models; a custom model with the same slug still works because built-ins win.

Origin: Tomáš asked that Auto work in threads that run only on his own device.
Favorites live in each server's settings, so a machine without the hub's settings had no Auto pinned. The picker now puts Auto High, Medium and Low from the first Claude instance that lists them at the top of Favorites, until the user stars an Auto level themselves.

Origin: Tomáš asked for the Auto levels to be the main pinned models in every thread.
Since every Claude provider lists the Auto levels (#6), "lists an Auto
model" no longer marks the instances launched with the Auto-mode prompt
(Auto, Auto B). The plain Claude instance shares their account and usage
and comes first in the registry, so Auto routed turns to it and the
orchestrator never got the routing instructions. Instances whose display
name starts with "Auto" now win the tie. The unused `auto` custom-model
descriptor goes with the old check.

Origin: Tomáš reported that Auto model routing does not work.
After the first message on Auto, the thread runs on the model Auto chose
(for example Auto B / Sonnet), while the composer still holds the Auto
selection on the instance it was picked from. The pending-handoff check
compared the two and showed "Context handoff pending" after every turn,
although the server keeps the thread's model while it fits. The check now
resolves an Auto selection the way the server does, so it only shows a
handoff when Auto would really move the thread to another account. Web and
mobile share the check; callers pass the current minute.

Origin: found while checking Auto in the real hub2 web UI for Tomáš.
The server replaces Auto with a concrete model per message and stored only
that, so after the first message every client showed "Sonnet 5.5 Low"
instead of "Auto Low", and a client without the fork's composer kept
sending the concrete model, which ended Auto routing for the thread.

The model Auto picks now carries an `auto` option with its level. The
server treats such a selection as Auto again on the next command (sticky
while it fits), and web and mobile show it in the composer as the Auto
level it came from. The pending-handoff preview only re-resolves Auto
level slugs, so a routed selection does not recurse.

Origin: Tomáš saw "Sonnet 5.5 Low" instead of Auto in a thread started on
Auto Low.
When a run on an Auto thread fails with a usage limit or no capacity,
bench that provider instance and send the thread back through Auto,
which skips benched instances, so work continues on the next
subscription instead of waiting hours for the reset.
… auto-resume

Review of the failover commit before it went on the PC:
- A thread that failed over to a weaker model stayed there while that
  account was under 90% used, even after the better account reset. The
  sticky rule now gives way when a better candidate has room.
- Failover follows the autoResumeLimitedThreads setting: off still
  benches the failed instance, but sends nothing on its own.
- Failover skips a provider's own subagent threads, which cannot
  receive messages.
… move to Auto

On the PC a thread stuck on Grok after Claude hit its limit: every Resume
failed with "Native resume is unavailable" and the thread never moved on.

- Resume on a provider without native resume starts an ordinary turn that
  asks the agent to continue, instead of failing.
- A thread not on Auto that hits a usage limit fails over through Auto at
  the level its model implies. Delegated threads keep their model.
When Auto failover moved a thread to Grok and Grok hit its limit on the
first turn, the thread kept Grok as its selection with no provider thread
for that instance. The client only allowed a handoff from a provider
thread matching the current selection, so the picker locked every other
provider ("Claude is unavailable in this thread"). The server hands off
from the app's own run history, so any provider thread of this app thread
is enough. The empty case stays locked as before.

Origin: Tomáš's screenshot in thread 'Agent Skills and Design Guide
Overhaul' (2026-11-16).
The branch replays the fork's features from tomas/pc-nightly on top of
upstream main (1f698f0). Fork main holds older copies of the same
commits, so a normal merge would conflict on every file that moved on
since. This merge keeps the replayed tree unchanged and only records
main's history as an ancestor, so the pull request into main merges
without a force-push.

Origin: Tomáš's request to bring the fork up to current upstream.
chore: sync the fork onto upstream main
Every account of a provider adds into one pool (two Claude accounts = 200%).
Each limits card now shows the summed headline, when the pool and the first
account run out, the next reset, the burn rate, and a recorded and projected
chart. Readings are kept in this browser to draw history and measure burn.
…ty, lists levels as picker rows

Between Claude accounts, Auto takes the freer 5-hour window; within 10 points it
spends the account whose weekly quota resets first. Antigravity's Claude models
follow the Claude subscriptions at every level. auto-low/auto-medium/auto-high fix
the level in the slug so the Auto picker tab lists one row per level. Usage limits
open with a per-subscription overview.
The button showed the model Auto routes to ("Auto · Opus 5.5 (A)"), which read as if Auto Medium were Opus. It now shows the level, such as "Auto Medium", and the tooltip names the current route.
Agents batched a whole task into one commit at the end, so history could
not show which request or review finding produced which change.

AGENTS.md gains a Commits section: commit and push each finished,
verified step of medium size or larger, one idea per commit, with a body
that states why and where the change came from (issue, PR, review
finding, thread link, or the request in one line).

Origin: Tomáš asked for more frequent, traceable orchestrator commits.
Auto sent work to the account with less 5-hour use, so both windows started together and ran out together. It now keeps using the account whose window is already running until any of its windows reaches 90%, then moves to the other, so one refreshes while the other works. Within 10 points of 5-hour use, the sooner weekly reset still goes first.

Origin: Tomáš asked that Auto pick the plan closer to running out and offset the 5-hour windows so one refreshes while the other is nearly used up. GPT review loop: 2 rounds, approved.
Auto Low, Medium and High existed only as custom models in the hub's settings, so a fork server on another machine (Tomáš's PC) showed no Auto at all. Every Claude provider now lists them as built-in models; a custom model with the same slug still works because built-ins win.

Origin: Tomáš asked that Auto work in threads that run only on his own device.
Favorites live in each server's settings, so a machine without the hub's settings had no Auto pinned. The picker now puts Auto High, Medium and Low from the first Claude instance that lists them at the top of Favorites, until the user stars an Auto level themselves.

Origin: Tomáš asked for the Auto levels to be the main pinned models in every thread.
Since every Claude provider lists the Auto levels (#6), "lists an Auto
model" no longer marks the instances launched with the Auto-mode prompt
(Auto, Auto B). The plain Claude instance shares their account and usage
and comes first in the registry, so Auto routed turns to it and the
orchestrator never got the routing instructions. Instances whose display
name starts with "Auto" now win the tie. The unused `auto` custom-model
descriptor goes with the old check.

Origin: Tomáš reported that Auto model routing does not work.
After the first message on Auto, the thread runs on the model Auto chose
(for example Auto B / Sonnet), while the composer still holds the Auto
selection on the instance it was picked from. The pending-handoff check
compared the two and showed "Context handoff pending" after every turn,
although the server keeps the thread's model while it fits. The check now
resolves an Auto selection the way the server does, so it only shows a
handoff when Auto would really move the thread to another account. Web and
mobile share the check; callers pass the current minute.

Origin: found while checking Auto in the real hub2 web UI for Tomáš.
The server replaces Auto with a concrete model per message and stored only
that, so after the first message every client showed "Sonnet 5.5 Low"
instead of "Auto Low", and a client without the fork's composer kept
sending the concrete model, which ended Auto routing for the thread.

The model Auto picks now carries an `auto` option with its level. The
server treats such a selection as Auto again on the next command (sticky
while it fits), and web and mobile show it in the composer as the Auto
level it came from. The pending-handoff preview only re-resolves Auto
level slugs, so a routed selection does not recurse.

Origin: Tomáš saw "Sonnet 5.5 Low" instead of Auto in a thread started on
Auto Low.
When a run on an Auto thread fails with a usage limit or no capacity,
bench that provider instance and send the thread back through Auto,
which skips benched instances, so work continues on the next
subscription instead of waiting hours for the reset.
… auto-resume

Review of the failover commit before it went on the PC:
- A thread that failed over to a weaker model stayed there while that
  account was under 90% used, even after the better account reset. The
  sticky rule now gives way when a better candidate has room.
- Failover follows the autoResumeLimitedThreads setting: off still
  benches the failed instance, but sends nothing on its own.
- Failover skips a provider's own subagent threads, which cannot
  receive messages.
… move to Auto

On the PC a thread stuck on Grok after Claude hit its limit: every Resume
failed with "Native resume is unavailable" and the thread never moved on.

- Resume on a provider without native resume starts an ordinary turn that
  asks the agent to continue, instead of failing.
- A thread not on Auto that hits a usage limit fails over through Auto at
  the level its model implies. Delegated threads keep their model.
When Auto failover moved a thread to Grok and Grok hit its limit on the
first turn, the thread kept Grok as its selection with no provider thread
for that instance. The client only allowed a handoff from a provider
thread matching the current selection, so the picker locked every other
provider ("Claude is unavailable in this thread"). The server hands off
from the app's own run history, so any provider thread of this app thread
is enough. The empty case stays locked as before.

Origin: Tomáš's screenshot in thread 'Agent Skills and Design Guide
Overhaul' (2026-11-16).
Each server now answers `server.getMachineStatus` with the machine it runs
on: host name, platform, cores, load, CPU share, memory, swap, disk, Linux
pressure (PSI), and its agents. Working agents are threads with a run that
is preparing, queued, starting or running (delegated children are threads,
so they count); open agents are threads whose provider session is alive
without such a run. The cap comes from the new server setting
`machineStatus.maxWorkingAgents` (null: memory alone decides). Reads are
cached for 5 s, so several clients polling share one sample. The
`machineStatus` capability tells clients which servers answer.

Linux reads /proc/meminfo and /proc/pressure directly, the host's view that
Hub Power and the hubs' rules use; other platforms take memory from
HostResources and have no pressure or load gates. The client setting
`machineBarEnabled` (default on) lets a device hide the bar.

Origin: Tomáš's request for a machine bar that replaces opening Hub Power
to decide where the next thread should start (brief of 2026-11-18).
`machineCapacity()` ports Hub Power's `capacity()` with its constants: free
memory minus a reserve (15% of RAM, at least 512 MB) over 700 MB per agent,
0 under memory pressure (PSI avg60 > 10), a busy CPU (5-minute load at 85%
of the cores, or CPU PSI avg60 > 25) or IO pressure (avg10 > 50, the hubs'
gate for heavy work), then capped by the machine's own agent limit. The
hubs' 800 MB gate needs no branch: the reserve already leaves no room below
about 1.2 GB. Windows has no load average, so its sampled CPU share stands
in.

`recommendNextMachine()` picks the machine with the most room; ties go to
the larger share of free memory, then to list order. With nothing free it
returns every reporting machine's reason.

Origin: Tomáš's machine bar brief of 2026-11-18.
A 22 px strip under the window's header row, across the sidebar, chat and
right panel, answers where the next thread should start:

- one chip per machine the client is connected to, deduped by host name:
  working agents over the machine's agent limit, free memory, and how many
  more agents fit, with a green/amber/red/grey dot (room, full, pressure,
  offline). Hover or click opens CPU load, memory, swap, disk, pressure,
  room, the agent limit and the machine's working and open agents.
- each Claude account's 5-hour and weekly use, named A and B the way the
  Auto picker names them, amber from 90% and red at 100%.
- `Next → <machine> · Auto: <model>`, the machine with the most room and
  the route Auto would take there, or `Next → wait (<reason>)`.

The columns' top-row headers reserve `--machine-bar-height` under
themselves, which the shell sets to 22 px only from the md breakpoint and
only while the bar shows, so narrow windows and phones keep their layout.
The bar polls each environment every 25 s while it is mounted.

Settings: General → Machine bar hides it per device; Maintenance → Agent
limit sets `machineStatus.maxWorkingAgents` per server. The A/B account
rule moved into `claudeAccountLetter` so the bar and the picker share it.
User docs gain a Machine bar section in usage.md.

Origin: Tomáš's machine bar brief of 2026-11-18 (replace opening Hub Power
to see machine load and where the next thread fits).
…ions

Two classification bugs from the review of the machine bar:

- A thread whose only active run was queued counted as working. A queued
  run on an idle thread waits on a held queue (stop with hold, failed
  worktree setup), a usage limit (computed by usageLimitHoldsQueue, not a
  payload flag) or the user, so it runs no agent. A thread that limits
  hold for hours made the bar report the machine at its cap. Working is
  now a run preparing, starting or running.
- A thread detached from a still-live session (handoff, stop) counted as
  open, because `provider-session.detached` deletes the binding but leaves
  `sessions.thread_id`. Open now follows the bindings only.

The test table gains a queued-only thread with a live session and a
detached session; it failed on the previous query (8 agents instead of
6).

Origin: read-only review of the machine bar branch (findings 1 and 2).
Review follow-ups for the machine bar:

- Below 768 px the bar was hidden with CSS but stayed mounted, so a phone
  on the web app polled every connected server while showing nothing. The
  shell now mounts it only when the md media query matches.
- A connected machine read "off" until its first answer arrived; it now
  shows its name and a grey dot while loading. A server that stops
  answering keeps no last numbers: after about two minutes without a fresh
  answer the chip reads "off".
- The popover showed PSI avg10 for every resource while the room gates use
  avg60 for CPU and memory; it now shows the averages the gates read.
- Provider status pushes re-rendered the whole bar. The Claude accounts and
  the Next part now read provider data in their own components, and the
  popover reads provider names only while open.
- Dropped the margin on DiffPanelShell's drag-region header: DiffPanel is
  only rendered embedded, so that header never shows.

The progress entry records the review and these fixes.

Origin: read-only review of the machine bar branch (findings 3, 4, 5, 7
and 8).
A transient RPC failure discarded the previousSuccess retained by the query, so a connected machine read as off until the next successful poll. Read the status through AsyncResult.value and keep the previous success timestamp, letting the existing staleness window decide when to go grey. Found in review of PR #28.
The entry was written in the sync merge b20ee0b, which this replay does not carry, so it comes back here as its own commit at the same point in the history.

Origin: the upstream sync replay of 2026-11-25.
The entry was written in the sync merge 2308bcc, which this replay does not carry, so it comes back here as its own commit at the same point in the history.

Origin: the upstream sync replay of 2026-11-25.
The entry was written in the sync merge 38a6410, which this replay does not carry, so it comes back here as its own commit at the same point in the history.

Origin: the upstream sync replay of 2026-11-25.
On a systemd user service with no interactive session, polkit refuses
`systemd-inhibit --mode=block` every time. The hold retried under backoff
forever and logged a full stack on each attempt (about 7,600 lines in
hub's boot-service.log on 2026-11-19).

An inhibitor exit whose stderr reports an access or authentication denial
now logs one warning without a stack and turns every later hold in the
process into a no-op. Other failures keep the existing backoff retry.
The retry policy moves into an exported makeHold so tests drive it with a
fake holdOnce on the TestClock.
The entry was written in the sync merge 6da64ec, which this replay does not carry, so it comes back here as its own commit at the same point in the history.

Origin: the upstream sync replay of 2026-11-25.
Upstream's durable workflows (pingdotgg#38882, merged in the 2026-11-23 sync)
retry a step whose turn died, on a thread of their own or the same
one. The fork's Auto failover sent "Continue where you left off" to
the dead step's thread 1.5 s later as well, so the step ran twice, and
a step whose workflow pinned a model was moved to Auto.

autoFailoverPlan now returns null for a thread whose lineage is a
workflow step, as it does for delegated threads not on Auto. Found by
the read-only review of the sync merge.
…nment

Upstream pingdotgg#41143 added useSidebarRowThreadKey.test.tsx with a delegated
child whose parent is in the same environment. In the fork that thread
is a launched thread, which keeps its own row on mobile
(nestLaunchedThreads: false), so the test failed on the 2026-11-23
sync merge. Its parent now lives in a linked environment, the case
upstream's delegatedFrom stands for, so the test checks re-renders as
upstream meant.
Records the 2026-11-23 sync: the conflicts and how each was resolved,
the catalog key both sides added, the two follow-up fixes, the checks,
the seeded server boot with migrations 106-110, the review, and the
agent-context growth that needs the agent-context-increase label.
Asked for by the main thread's sync request.
Upstream pingdotgg#41814 (merged in the d73e41a sync) opens a queued
message's edit on the run's model and saves the edit with the
composer's pick. On an Auto thread that model is the concrete one Auto
routed to, stamped with an `auto` option, and the composer keeps only
the options a model describes. A save, even of the text alone, sent
the concrete model without the stamp: the message left Auto, no
longer followed a failover, and ran on the subscription it was first
routed to.

The edit now opens an Auto-routed pick as its Auto level
(autoLevelSelection), as the pickers already show a routed thread, so
saving routes the message through Auto again. The new case in
useQueuedRunEdit.browser.test.tsx failed on the merge (the draft held
claude-opus-5-5 with the stamp) and passes. Mobile kept the stamp on
save but showed the concrete model while editing; its queue sheet now
opens on the Auto level too.

Origin: a semantic conflict between pingdotgg#41814 and the fork's Auto
routing, found while merging upstream d73e41a.
Upstream pingdotgg#30253 (merged in the d73e41a sync) lets the scheduled
task editor set reasoning effort, and saves the draft's selection with
the options the effort picker rebuilds from the model's descriptors. A
task scheduled with schedule_task from an Auto thread stores that
thread's routed model plus the `auto` option, which no model
describes, so changing the effort dropped it: the task left Auto and
ran on the subscription its thread was routed to when it was made.
Before pingdotgg#30253 the editor saved the stored selection while the model
stayed the same, which kept the option.

taskToDraft now opens an Auto-routed pick as its Auto level
(autoLevelSelection), as the composer pickers do, so the editor shows
Auto and the task stays on it. The new case in
scheduledTasksSettings.logic.test.ts failed on the merge (the draft
held claude-opus-5-5) and passes.

Origin: the read-only review of the upstream sync, which found this
semantic conflict between pingdotgg#30253 and the fork's Auto routing.
Records the 2026-11-24 sync: the merge's conflicts and their resolutions, the two Auto follow-ups, the calls made on upstream changes that touch fork features, the checks, the real run on a seeded copy of the live data, the review, and what switching the hubs needs.
Tomáš keeps model names out of public attribution; the 2026-11-24 entry named the reviewer's model id.
Requested by Tomas: spend the Plus allowance before Antigravity Opus at high and medium, and preserve low-cost candidates at low. Skip unlisted models, bench lapsed Claude subscriptions like usage limits, and align hand-picked failover levels with the new candidates.
…eplaces

Upstream pingdotgg#42499 and pingdotgg#42502 turned the pooled limit refill line into one
translated sentence. The fork's pooled view replaces that line with its
Next reset stat, so the sentence's key (0e34c3076c08feb2) has no source
left and `vp run i18n:check` reported it stale. Removed from en and the
nine translations; no other key changes.

Origin: the sync of the fork onto upstream c5d6aa1.
Upstream pingdotgg#42037 made the pooled refill line skip a reset whose time has
passed while the account data is still stale, and pinned it with a test
that expects upstream's refill text. The fork's pooled view shows the
next refill in its Next reset stat instead, from the projection, whose
first refill can be such an elapsed reset: with Work reset at 17:00 and
Personal at 18:00, at 17:30 it read "+20% 5:00 PM".

The stat now takes the first refill after now, as upstream's line does.
Upstream's case keeps its accounts and times and checks the stat: at
17:30 it names Personal's +60%, and at 18:00 no refill is left. The case
failed on the sync (it found "+20%") and passes with the change.

Origin: the sync of the fork onto upstream c5d6aa1.
Upstream pingdotgg#42106 checks a launch's modelSelection options against the
model's option descriptors and refuses any it does not declare. An Auto
thread's selection is the model Auto routed to plus the `auto` option
that holds its level, which no model declares, so a launch that passed
it (copied from an Auto thread) now failed with "Unknown option auto"
and created nothing. Before pingdotgg#42106 the selection went through as given
and Auto routing replaced it when the thread ran.

The launch still requires an advertised model, but leaves an Auto
selection's options to Auto routing. The new case in handlers.test.ts
failed on the sync and passes; the file passes 23/23.

Origin: the sync of the fork onto upstream c5d6aa1.
Upstream pingdotgg#42210 immediately settles delegated tasks. The fork records local launch lineage in the same field, so those launches need the ordinary thread policy. Compare the delegating environment with the server identity and retain immediate settlement for subagents and remote tasks. Regression failed before the fix; 53 focused tests and final changed-file checks pass. Origin: upstream sync requested on 2026-11-25.
Independent sync review found catalog validation could reject an Auto-stamped selection before routing replaced its model. Leave catalog validation to concrete selections and extend the Auto launch regression with a retired model. The regression failed before this change and passes with the fix; all changed-file checks pass. Origin: upstream sync review S2.
Independent sync review found the projection emits resets in account order within each simulation step. Session and weekly reset orders can differ, so find could show a later weekly reset. Select the earliest future timestamp and extend the existing browser regression to reproduce both resets in one step. It failed before the fix and all changed-file checks pass after it. Origin: upstream sync review S1.
Record origin/main fd58958 as an ancestor after replaying the fork onto upstream and verifying the integration fixes. This ancestry-only ours merge keeps fork main history mergeable without force-pushing. Include the checks, scratch boot and independent review in progress.md. Origin: maintainer request to sync 280 upstream commits on 2026-11-25.
@radys-s radys-s closed this Nov 25, 2026
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +90 test cases (browser +2, unit +63, server +25).

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant