Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Combined merge 10-30 C: three reviewed PRs (#2292 #2293 #2294) (#2302)

0xken15544f7780f945
diff --git a/backend/src/superTabs/commands.test.ts b/backend/src/superTabs/commands.test.ts
index 04cfe5d4d..82ed42484 100644
--- a/backend/src/superTabs/commands.test.ts
+++ b/backend/src/superTabs/commands.test.ts
@@ -1634,7 +1634,7 @@ describe('Reviewer role', () => {
const said = markReady(`Ready: yes.\n${pr}`).messages.filter(m => m.source?.kind === 'review-capacity')
expect(said).toMatchObject([{ conversationId: f.state.projects![0]!.leadConversationId, recipients: [], mentions: ['owner'] }])
expect(said[0]!.text).toBe('Reviews of Codex builds cannot start a new Reviewer: Claude Code is unavailable on every machine this project may use (Studio: out of quota). '
- + 'More Claude Code quota, Claude Code signed in on another machine, or another machine in the Swarm would unblock them. @owner can fix it.')
+ + 'More Claude Code quota, Claude Code signed in on another machine, a paused machine resumed, or another machine in the Swarm would unblock them. @owner can fix it.')
expect(markReady(`Ready: yes, again.\n${pr}`).messages.filter(m => m.source?.kind === 'review-capacity')).toEqual([])
})
diff --git a/backend/src/superTabs/reviewCapacity.test.ts b/backend/src/superTabs/reviewCapacity.test.ts
index 0524de6e8..82550f587 100644
--- a/backend/src/superTabs/reviewCapacity.test.ts
+++ b/backend/src/superTabs/reviewCapacity.test.ts
@@ -3,6 +3,7 @@ import type { ContributedMachine } from './machines.js'
import { createSuperTab, type Conversation, type SuperTabState } from './model.js'
import { DEFAULT_ROUTING_POLICY } from './routingPolicy.js'
import { RELAYED_QUOTA, reviewCapacityNotice } from './reviewCapacity.js'
+import { reviewRefusal } from './rules.js'
// Overnight 2026-10-30, 12 pull requests waited hours for a review: every Codex Reviewer was out of weekly quota, a Claude
// Reviewer may not check a Claude build, and nobody was told until people noticed in the morning (Tony: "don't let the
@@ -52,7 +53,7 @@ describe('the notice that new Reviewers cannot start', () => {
// Claude Opus can still start on these machines, so reviews fall back to it (rules.ts judgeReview).
expect(first!.text).toBe('Reviews of Claude Code builds fall back to Claude Code at its top tier: Codex is unavailable on every machine this project may use '
+ '(Mac Studio: out of quota; MacBookPro2021: signed out; MacBook Pro 19: out of quota). More Codex quota, Codex signed in on another machine, '
- + 'or another machine in the Swarm would bring back reviews on another engine. @ken15 @huy @tony can fix it.')
+ + 'a paused machine resumed, or another machine in the Swarm would bring back reviews on another engine. @ken15 @huy @tony can fix it.')
// A person's own numbers are never shown to the others.
expect(first!.text).not.toMatch(/\d+ ?%/)
expect(notice(state, built, anyMachine, NOW + HOUR)).toBeNull()
@@ -63,7 +64,17 @@ describe('the notice that new Reviewers cannot start', () => {
studio.observation!.readiness!.engines![0]!.signedIn = false
const { state, built } = swarm([studio])
expect(notice(state, built)!.text).toBe('Reviews of Claude Code builds cannot start a new Reviewer: Codex is unavailable on every machine this project may use '
- + '(Mac Studio: out of quota). More Codex quota, Codex signed in on another machine, or another machine in the Swarm would unblock them. @ken15 can fix it.')
+ + '(Mac Studio: out of quota). More Codex quota, Codex signed in on another machine, a paused machine resumed, or another machine in the Swarm would unblock them. @ken15 can fix it.')
+ })
+
+ it('says reviews fall back only when the server would let them: not while it counts a Codex agent on a host outside the contributions', () => {
+ // Re-review of #2275: the notice said "fall back to Claude Code" while rules.ts refused it.
+ const { state, built } = swarm([machine('studio', 'Mac Studio', 'ken', { windows: out })])
+ state.agents.push({ id: 'codex-elsewhere', name: 'Codex', machineId: 'elsewhere', harnessId: 'hx', contributorId: 'ken',
+ configuration: { engine: 'codex', model: 'default', effort: 'high' } } as never)
+ const reviewer = { machineId: 'studio', engine: 'claude', model: 'claude-opus-4-7', effort: 'high' }
+ expect(reviewRefusal(state, built.id, reviewer, DEFAULT_ROUTING_POLICY, anyMachine, NOW)).not.toBeNull()
+ expect(notice(state, built)!.text).toMatch(/^Reviews of Claude Code builds cannot start a new Reviewer: /)
})
it('counts a paused machine as unable to start a Reviewer, as the route does', () => {
@@ -77,7 +88,7 @@ describe('the notice that new Reviewers cannot start', () => {
expect(warned).toMatchObject({ mentions: ['ken', 'tony'], source: { kind: 'review-capacity', engine: 'codex', cause: 'low' } })
expect(warned!.text).toBe('Codex quota for reviewing Claude Code builds is close to running out on every machine this project may use '
+ '(Mac Studio: close to running out; MacBook Pro 19: out of quota). More Codex quota, Codex signed in on another machine, '
- + 'or another machine in the Swarm would keep reviews going. @ken15 @tony can fix it.')
+ + 'a paused machine resumed, or another machine in the Swarm would keep reviews going. @ken15 @tony can fix it.')
expect(notice(state, built)).toBeNull()
state.machines![0]!.observation!.quotas[0]!.windows[0]!.usedPercent = 100
expect(notice(state, built)).toMatchObject({ source: { cause: 'out' } })
diff --git a/backend/src/superTabs/reviewCapacity.ts b/backend/src/superTabs/reviewCapacity.ts
index cccfd28de..620d67159 100644
--- a/backend/src/superTabs/reviewCapacity.ts
+++ b/backend/src/superTabs/reviewCapacity.ts
@@ -5,7 +5,7 @@
import type { Conversation, SuperTabState } from './model.js'
import { canReadProject, groupProject, projectRules } from './projects.js'
import { canStart, STANDING, standing, type Standing } from './reviewSeats.js'
-import { liftEffort, type MayRun } from './rules.js'
+import { liftEffort, otherFamilyReviews, type MayRun } from './rules.js'
import type { RoutingPolicy } from './routingPolicy.js'
import { usernameOf } from './usernames.js'
@@ -71,8 +71,11 @@ export function reviewCapacityNotice(state: SuperTabState, group: Conversation,
// A tag is a username; someone without one is not tagged, never named by their email (review of #2275).
const mentions = [...new Set(places.map(p => p.contributorId))].filter(id => reads(id) && usernameOf(state, id))
const who = mentions.map(id => `@${usernameOf(state, id)}`).join(' ')
- const fixes = `More ${NAME[engine]} quota, ${NAME[engine]} signed in on another machine, or another machine in the Swarm`
- const fallback = cause === 'out' && seats(state, group, built, policy, mayRun, now, 3).some(p => canStart(p.standing))
+ const fixes = `More ${NAME[engine]} quota, ${NAME[engine]} signed in on another machine, a paused machine resumed, or another machine in the Swarm`
+ // Reviews fall back only as the server's own judgement lets them (rules.ts judgeReview): it also counts an agent of the
+ // other engine on a host outside the contributions, which the machines above leave out (re-review of #2275).
+ const fallback = cause === 'out' && !otherFamilyReviews(state, { engine: built }, policy, mayRun, now)
+ && seats(state, group, built, policy, mayRun, now, 3).some(p => canStart(p.standing))
const text = (cause === 'low'
? `${NAME[engine]} quota for reviewing ${NAME[built]} builds is close to running out on every machine this project may use (${list}). ${fixes} would keep reviews going.`
: fallback
diff --git a/backend/src/superTabs/rules.ts b/backend/src/superTabs/rules.ts
index 66e9668a3..e80497909 100644
--- a/backend/src/superTabs/rules.ts
+++ b/backend/src/superTabs/rules.ts
@@ -139,7 +139,7 @@ export type MayRun = (target: RunTarget, contributorId: string) => boolean
* that engine runs on that is up and not held by a usage limit past it. Busy still counts: a Reviewer frees up. One out of
* quota for days, offline or left out by the owner's machines does not (2026-10-30: reviews of Claude builds waited all
* morning on Codex machines out of weekly quota). */
-function otherFamilyReviews(state: SuperTabState, builder: { engine: string; gridModel?: string }, policy: RoutingPolicy, mayRun: MayRun, now: number): boolean {
+export function otherFamilyReviews(state: SuperTabState, builder: { engine: string; gridModel?: string }, policy: RoutingPolicy, mayRun: MayRun, now: number): boolean {
const pool = (machineId: string) => state.machines?.find(m => m.machineId === machineId)
const soon = (agent: Agent) => !downSince(state, agent, now) && !(agent.limitedUntil && Date.parse(agent.limitedUntil) - now > REVIEW_START_MS)
const places = [...state.agents.filter(a => !a.gridModel && !a.buddyOf && soon(a)).map(a => ({ machineId: a.machineId, contributorId: a.contributorId, engines: [a.configuration.engine] })),
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index e94e87f07..afda03dc3 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -561,11 +561,12 @@ class _SuperTabViewState extends State<SuperTabView>
/// and Jump to latest while the list is away from its newest message.
void _checkUnreadLine() {
final scroll = _scroll[c.selectedId];
- var away = false, below = false;
- // A jump still landing passes lines it does not stop at: measured once
- // it has landed.
+ // A jump still landing passes lines it does not stop at: the pill stays
+ // as it was until the line is measured where the jump landed.
+ final landing = _landing != null;
+ var away = landing && _unread.away, below = landing && _unread.below;
if (_unread.lineAt(c.selectedId) case final lineAt?
- when scroll != null && scroll.hasClients && _landing == null) {
+ when scroll != null && scroll.hasClients && !landing) {
final line = _unread.key.currentContext;
final top = line == null ? null : _topInList(line);
final view = scroll.position.viewportDimension;
diff --git a/desktop/test/super_tab_new_messages_test.dart b/desktop/test/super_tab_new_messages_test.dart
index 560e0985c..0168889c4 100644
--- a/desktop/test/super_tab_new_messages_test.dart
+++ b/desktop/test/super_tab_new_messages_test.dart
@@ -497,6 +497,41 @@ void main() {
expect(find.byKey(_jump), findsNothing);
});
+ testWidgets('a second link in a chat showing the pill keeps it steady on '
+ 'the way', (tester) async {
+ final c = await show(tester, offlineChat(22));
+ c.openMessageLink(
+ const SwarmMessageLink(
+ tabId: 'tab',
+ conversationId: 'offline',
+ messageId: 'message-60',
+ ),
+ );
+ await tester.pumpAndSettle();
+ expect(find.byKey(_jump), findsOneWidget);
+ c.openMessageLink(
+ const SwarmMessageLink(
+ tabId: 'tab',
+ conversationId: 'offline',
+ messageId: 'message-40',
+ ),
+ );
+ for (var frame = 0; frame < 30; frame++) {
+ await tester.pump(const Duration(milliseconds: 16));
+ expect(find.byKey(_jump), findsOneWidget, reason: 'frame $frame');
+ }
+ await tester.pumpAndSettle();
+ expect(
+ onScreen(
+ tester,
+ find.byKey(const ValueKey('super-message-message-40')),
+ chat: 'offline',
+ ),
+ isTrue,
+ );
+ expect(find.byKey(_jump), findsOneWidget);
+ });
+
testWidgets('opened at a linked message below the line, a pill above the '
'list takes the reader back to it, then goes', (tester) async {
final server = _server(2);
diff --git a/mobile/lib/swarm/swarm_conversation_page.dart b/mobile/lib/swarm/swarm_conversation_page.dart
index 131feab07..b5ec77928 100644
--- a/mobile/lib/swarm/swarm_conversation_page.dart
+++ b/mobile/lib/swarm/swarm_conversation_page.dart
@@ -1338,7 +1338,7 @@ class _SwarmConversationPageState extends State<SwarmConversationPage>
final line = root == m.id ? c.thread(m.id) : null;
final faces = line == null
? const <SwarmThreadFace>[]
- : swarmThreadFaces(snapshot, line);
+ : swarmThreadFaces(snapshot, line, roles: view.roles);
final name = _nameOf(c, m);
final look = _lookOf(c, m);
final pm = swarmIsPmLine(c.reader, m);
@@ -1379,7 +1379,7 @@ class _SwarmConversationPageState extends State<SwarmConversationPage>
line,
[
for (final who in faces)
- '${who.id}:${who.name}:${swarmLookKey(who.look)}',
+ '${who.id}:${who.name}:${who.pm}:${swarmLookKey(who.look)}',
].join(','),
),
() => SwarmMessageRow(
diff --git a/mobile/lib/swarm/swarm_thread_line.dart b/mobile/lib/swarm/swarm_thread_line.dart
index d78205369..6c207696a 100644
--- a/mobile/lib/swarm/swarm_thread_line.dart
+++ b/mobile/lib/swarm/swarm_thread_line.dart
@@ -25,16 +25,19 @@ typedef SwarmThreadFace = ({
String name,
String id,
bool agent,
+ bool pm,
SwarmLook look,
});
/// The newest reply authors of [thread] as [snapshot] names and dresses them:
/// an agent by the Swarm's name for it, a person by their address's first
-/// part, as the chat names a message's author.
+/// part, as the chat names a message's author. [roles] are the chat's agent
+/// roles: the PM wears manager blue here as on its own messages.
List<SwarmThreadFace> swarmThreadFaces(
SuperTabSnapshot? snapshot,
- SuperTabThread thread,
-) => [
+ SuperTabThread thread, {
+ Map<String, String> roles = const {},
+}) => [
for (final author in thread.authors)
if (author['id'] case final String id)
author['kind'] == 'agent'
@@ -50,12 +53,14 @@ List<SwarmThreadFace> swarmThreadFaces(
as String,
id: id,
agent: true,
+ pm: roles[id] == 'PM',
look: snapshot?.agentLook(id) ?? (picture: null, status: null),
)
: (
name: superTabPersonName(author['name'] as String? ?? ''),
id: id,
agent: false,
+ pm: false,
look: snapshot?.personLook(id) ?? (picture: null, status: null),
),
];
@@ -104,6 +109,7 @@ class SwarmThreadLine extends StatelessWidget {
name: who.name,
id: who.id,
agent: who.agent,
+ pm: who.pm,
picture: who.look.picture,
status: who.look.status,
diameter: face,
diff --git a/mobile/test/swarm/swarm_thread_line_faces_test.dart b/mobile/test/swarm/swarm_thread_line_faces_test.dart
index e63cfb49c..102f18149 100644
--- a/mobile/test/swarm/swarm_thread_line_faces_test.dart
+++ b/mobile/test/swarm/swarm_thread_line_faces_test.dart
@@ -72,4 +72,29 @@ void main() {
// Their size is unchanged.
expect(tester.getSize(find.byWidget(left)).width, SwarmThreadLine.face);
});
+
+ testWidgets('the PM wears manager blue as on its own messages, another '
+ 'agent its own colour', (tester) async {
+ final snapshot = swarm();
+ Future<SwarmChatAvatar> lead(Map<String, String> roles) async {
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Scaffold(
+ body: SwarmThreadLine(
+ thread: thread,
+ faces: swarmThreadFaces(snapshot, thread, roles: roles),
+ onOpen: () {},
+ ),
+ ),
+ ),
+ );
+ return tester
+ .widgetList<SwarmChatAvatar>(find.byType(SwarmChatAvatar))
+ .elementAt(1);
+ }
+
+ expect((await lead({'agent-lead': 'PM'})).pm, isTrue);
+ expect((await lead({'agent-lead': 'Builder'})).pm, isFalse);
+ expect((await lead(const {})).pm, isFalse);
+ });
}