Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
a206d31
glm cuda: the L2 prefetch's ffn-head site also reads a MoE layer's sh…
Bizuayeu Nov 13, 2026
d6b071b
changelog: #3156 under Unreleased
ashhart Nov 19, 2026
29884d6
flashnext cuda: the mixed PLE shard and the nested shards leave the p…
jschmied Nov 15, 2026
87515d8
gradient-serving pins: the two Flash Next load files #3467 changes
jschmied Nov 16, 2026
2e8bd28
changelog: #3467 under Unreleased
ashhart Nov 19, 2026
e92353b
nemotron: drop the Living Weights copies the 10-17 revert left behind…
jschmied Nov 17, 2026
9aae35a
changelog: #3707 under Unreleased
ashhart Nov 19, 2026
23b9174
Ling-3.0-tiny MLA on Metal using existing k3_mla (#1247)
ThinkOffApp Nov 16, 2026
64c33dd
Ling MLA Metal: split GPU tests and one-line comments for lean check
ThinkOffApp Nov 16, 2026
809a722
Ling MLA Metal: kernel contract for rope_cache, rope_q, gate_expand
ThinkOffApp Nov 16, 2026
971ac6a
changelog: #3609 under Unreleased
ashhart Nov 19, 2026
074a79f
app: honor the latest ticket review verdict
AIFlowML Nov 15, 2026
92d711f
app: invalidate ticket reviews after new builder evidence
AIFlowML Nov 15, 2026
66cde05
app: keep review notes and worker evidence scoped to their run
AIFlowML Nov 17, 2026
2103a02
changelog: #3484 under Unreleased
ashhart Nov 19, 2026
e19b2d1
Use the native Qwen3.5-2B tap count in Desktop
AIFlowML Nov 18, 2026
898414f
changelog: #3768 under Unreleased
ashhart Nov 19, 2026
24909b2
Accept OpenAI base URLs in Web engine settings
AIFlowML Nov 18, 2026
f669233
changelog: #3831 under Unreleased
ashhart Nov 19, 2026
96480a0
Keep Desktop export actions tied to the current preview
AIFlowML Nov 18, 2026
25cf2ab
changelog: #3834 under Unreleased
ashhart Nov 19, 2026
01813fd
Cancel pending Desktop checks when automatic updates are disabled
AIFlowML Nov 18, 2026
e50c927
changelog: #3836 under Unreleased
ashhart Nov 19, 2026
dc65f57
Preserve attachment diagnostics across Desktop draft reopens
AIFlowML Nov 18, 2026
10deb5f
changelog: #3842 under Unreleased
ashhart Nov 19, 2026
493f9e2
core/quant: a GPTQ reader for AutoGPTQ v1 group 128 symmetric weights
BadAd84 Nov 16, 2026
4d62482
core/quant: gptq reads its JSON fields through modelopt's helpers
ashhart Nov 17, 2026
36bf42d
core/quant: drop gptq's test-only zerosSymmetric wrapper
ashhart Nov 17, 2026
fd78f3e
core/quant: gptq refuses an escaped letter, a bad checkpoint_format a…
BadAd84 Nov 17, 2026
13ab186
changelog: #3611 under Unreleased
ashhart Nov 19, 2026
1d6d951
idol: Idol's denoiser as a native Metal family, with tf-idol and its …
jayleaton Oct 31, 2026
c6856c7
contract: Idol's denoiser kernels through gates 1-5
jayleaton Oct 31, 2026
8fd0dd0
idol: id_qk keeps a NaN norm as F.normalize does; the recipe
jayleaton Oct 31, 2026
556b530
idol: attention rounds P to fp16 before P V, so its denominator sums …
jayleaton Oct 31, 2026
c153dc1
idol: the recipe names the tensor units' fp32 operand truncation (#1772)
jayleaton Oct 31, 2026
0eb4c3e
notices: idol.metal follows idol-sdk's rounding points (Apache 2.0)
jayleaton Nov 11, 2026
8812e63
idol_case.py: a synthetic-conditioning case, feature1 and feature2 dr…
jayleaton Nov 11, 2026
211d468
idol: land on main beside uocr, with the image programs in their own …
ashhart Nov 17, 2026
1be48fc
changelog: #1766 under Unreleased
ashhart Nov 19, 2026
6216f0b
drama voices: admin keys add and delete catalog voices under --manage…
ashhart Nov 13, 2026
b1950a0
server: the voice HTTP test runs only where its Unix socket pair exists
ashhart Nov 15, 2026
bb4d0f2
drama voices: bound WAV chunk and resample admission
ashhart Nov 17, 2026
3766e28
changelog: #3140 under Unreleased
ashhart Nov 19, 2026
b0bdc80
feat(cli): validate a cluster config file without planning or probes
mvanhorn Nov 13, 2026
438c736
docs(cluster): scope config validate to source builds, rename backend…
mvanhorn Nov 14, 2026
13ce812
changelog: #3189 under Unreleased
ashhart Nov 19, 2026
a12e68e
server: an opt-in request journal with replay and crash quarantine
ashhart Nov 17, 2026
e84ce42
Document prompt-list replay limits and pin journal trace isolation
ashhart Nov 17, 2026
5a5aa40
changelog: #3221 under Unreleased
ashhart Nov 19, 2026
93fb56e
Qwen3.5 on Metal holds its language model without the vision tower st…
jschmied Nov 15, 2026
7ec6bed
changelog: #3407 under Unreleased
ashhart Nov 19, 2026
63210ab
families: Nemotron, GLM, Qwen 3.8 27B, MiniMax M3, Dory, tensor-paral…
ashhart Nov 16, 2026
34d58eb
changelog: #3558 under Unreleased
ashhart Nov 19, 2026
06b17ff
docs: verify NCCL selection for switchless GLM TP4
vdalesandro Nov 12, 2026
e5443fa
docs: tighten switchless NCCL note and cite upstream release
vdalesandro Nov 12, 2026
0a59efd
docs: the switchless NCCL notes wrapped at 120 columns, and 'a newer …
ashhart Nov 14, 2026
bd5eb12
changelog: #2993 under Unreleased
ashhart Nov 19, 2026
5c6598c
nvfp4 experts cuda: decode half gate-up streams words, scales and x t…
eleqtrizit Nov 4, 2026
8e4341b
nvfp4 experts cuda: classic, waves and half decode kernels share one …
eleqtrizit Nov 4, 2026
5446b8b
nvfp4 experts contract: decode CTA records from nvcc 13.0.88, with a …
eleqtrizit Nov 5, 2026
4d248b8
nvfp4 experts contract: zig fmt the decode CTA records
eleqtrizit Nov 5, 2026
c407799
CHANGELOG: NVFP4 decode expert ring on sm_120 and GB10
eleqtrizit Nov 8, 2026
8788791
nvfp4 experts cuda: GB10 keeps register-loaded decode kernels
eleqtrizit Nov 8, 2026
f97927b
CHANGELOG: move the NVFP4 decode ring line back under Unreleased
eleqtrizit Nov 9, 2026
4cd37b2
tests: re-pin zig/kernels/cuda/nvfp4_experts.cu for #2266
ashhart Nov 13, 2026
ec59d59
changelog: #2266's line from lines/2266.txt in place of its own
ashhart Nov 19, 2026
ce52af0
docs: GLM-5.3-Flash Jammed XSFP4 NZ5 is in 1.2.10
Bizuayeu Nov 18, 2026
f055e38
changelog: #3869 under Unreleased
ashhart Nov 19, 2026
5c81fb2
Scope Desktop search project filtering to all conversations
AIFlowML Nov 19, 2026
e25a573
changelog: #3900 under Unreleased
ashhart Nov 19, 2026
63a3a30
docs: budget released drafter adaptation by class reuse
Maxrio9 Nov 18, 2026
9f5ea57
docs: adaptation numbers on the independent agent set
Maxrio9 Nov 18, 2026
c1cc2f8
changelog: #3369 under Unreleased
ashhart Nov 19, 2026
8e9794c
docs: the Qwen3.8-27B recipe names --thinking-budget 4096 for thinkin…
Nipale-ai Nov 14, 2026
b2a7f92
docs: the Qwen3.8-27B recipe says a request's thinking_budget must be…
Nipale-ai Nov 14, 2026
a6aa7f4
changelog: #3373 under Unreleased
ashhart Nov 19, 2026
9c3090d
docs: ledger rows 30-32 for Flash Next HIP fusion, stream-tile prefet…
gilby Nov 14, 2026
caaac0c
changelog: #3160 under Unreleased
ashhart Nov 19, 2026
a70c90e
glm exl3: decode windows on the 16-pair item plan
BadAd84 Nov 3, 2026
653feba
glm exl3 items: the GPU check runs at GLM-5.3-Flash served size
BadAd84 Nov 3, 2026
aa24a18
changelog: #2044 under Unreleased
BadAd84 Nov 13, 2026
c190d34
glm: retain whole-prompt ownership while integrating decode item plans
ashhart Nov 14, 2026
b55665a
glm cuda tests: one dispatch line for the glm-exl3 commands
BadAd84 Nov 16, 2026
d4f40ac
glm exl3 items test: pass null for block32, as main's Kernels.load ta…
ashhart Nov 17, 2026
92b81dc
changelog: #2044 under Unreleased
ashhart Nov 19, 2026
143d1c0
tools: served gates prove they ran: drafts landed, the sampler and th…
jschmied Nov 17, 2026
8deb8ac
tools tests: the fake keeps requests sent together open until a censu…
jschmied Nov 18, 2026
596ccc0
tools tests: the fake waits for a census only while one is read
jschmied Nov 19, 2026
5836c4d
tools tests: while a census is polled, the fake waits 60 ms for a req…
jschmied Nov 19, 2026
f02bf7e
changelog: #3708 under Unreleased
ashhart Nov 19, 2026
a25b11a
qwen27: qk projections on M5, reading weight_layout in place
ashhart Nov 6, 2026
97dfb10
qwen27: flat glue kernels for the tree scan, GDN prepare, activation …
ashhart Nov 6, 2026
f3986c8
metal: Metal 4 submission for Qwen27 verify passes
ashhart Nov 6, 2026
068b618
tests: tf-qwen27-stack-ab, stock kernels on Metal 3 against qk, glue …
ashhart Nov 6, 2026
3da703f
metal4: the unfair lock is a stand-in off Apple, so Linux builds that…
ashhart Nov 11, 2026
5ef2ce9
metal4: the unfair lock's stand-in comment on one line (lean)
ashhart Nov 12, 2026
c9e808e
metal: contract the chunked tree-round picks against the row reduction
ashhart Nov 12, 2026
a8f1711
qwen27: the long-key comment within 120 columns (lean)
ashhart Nov 14, 2026
13229ca
qwen27: contract the qk and flat Metal replacements
ashhart Nov 17, 2026
437510a
changelog: #2342's line from lines/2342.txt in place of its own
ashhart Nov 19, 2026
ef1a05d
qwen3_5: its CUDA and HIP settings read through platform/environment.zig
ashhart Nov 16, 2026
a72e4b9
changelog: #3520 under Unreleased
ashhart Nov 19, 2026
72beb55
server: GET /v1/models/{id} returns one served model's entry
ashhart Nov 18, 2026
640a4f7
changelog: #3535 under Unreleased
ashhart Nov 19, 2026
f175069
Repair recording fixtures and restore the remaining 2031 host checks
ashhart Nov 18, 2026
a553ab4
changelog: #3751 under Unreleased
ashhart Nov 19, 2026
f26bc50
core: a two-session KV isolation test across spill, offload and a ret…
ashhart Nov 18, 2026
5eee384
changelog: #3840 under Unreleased
ashhart Nov 19, 2026
7f6f701
tools: compare drafted and plain IDs on recorded BF16 near-ties
ashhart Nov 18, 2026
9ec98ed
changelog: #3841 under Unreleased
ashhart Nov 19, 2026
f3fc437
contract: the later nvcc releases' usage table moves to registry_cuda…
ashhart Nov 18, 2026
5aa4433
changelog: #3865 under Unreleased
ashhart Nov 19, 2026
01bc8bf
host ci: run the HIP follower step-parser tests in the nightly Linux …
ashhart Nov 13, 2026
194b71f
Keep HIP build registration within the source length limit
ashhart Nov 17, 2026
5a5fc82
changelog: #3091 under Unreleased
ashhart Nov 19, 2026
cefe353
test: give FakeHub its own thread-safe allocator
ashhart Nov 17, 2026
b6a4aa7
Test pull clients with private I/O and trace-free leak checking
ashhart Nov 18, 2026
38a0e76
changelog: #3740 under Unreleased
ashhart Nov 19, 2026
46cb870
Gemma 4 on Metal refuses an image input it cannot load instead of cra…
jschmied Nov 15, 2026
670a6a7
changelog: #3421 under Unreleased
ashhart Nov 19, 2026
e6a420a
xpu: add Level Zero multi-GPU P2P AllReduce collectives and tf-xpu-tp…
supernovae Nov 16, 2026
08ac529
changelog: #3585 under Unreleased
ashhart Nov 19, 2026
c634abc
Recognize qualified Qwen 27B geometry in Desktop library
AIFlowML Nov 18, 2026
9c27a20
changelog: #3771 under Unreleased
ashhart Nov 19, 2026
5c56791
glm/cuda: the other ranks sleep on their lines while rank 0's vision …
ultradaoto Nov 17, 2026
edb7c59
changelog: name #3675 beside #3614
ultradaoto Nov 17, 2026
e17dfb8
changelog: #3675 below #3132, clear of the lines main adds at the top
ultradaoto Nov 17, 2026
f2b9968
contract: gate dsv41 xmma units launches on tensor units in Metal limits
gilby Nov 16, 2026
22ee12f
changelog: #3522 under Unreleased
ashhart Nov 19, 2026
0ce0aa3
Find an existing uv Web install outside PATH
AIFlowML Nov 18, 2026
ff5274c
changelog: #3748 under Unreleased
ashhart Nov 19, 2026
b10c7d9
Refresh the device profile when the Mac wired limit changes
AIFlowML Nov 18, 2026
a9f9738
changelog: #3780 under Unreleased
ashhart Nov 19, 2026
81f382b
Use the compiler library path in the cache restat tests
AIFlowML Nov 18, 2026
dc34480
changelog: #3786 under Unreleased
ashhart Nov 19, 2026
17e7407
changelog: #3125's line once, under 1.2.10
Bizuayeu Nov 19, 2026
fa48a29
changelog: #3916 under Unreleased
ashhart Nov 19, 2026
49acc7d
glm metal: vectorize pre-M5 Metal prompt, KDA, and indexer kernels
gilby Nov 19, 2026
83775a2
changelog: #3921 under Unreleased
ashhart Nov 19, 2026
9fb2f2b
app: preserve per-agent reasoning effort across Room runs
AIFlowML Nov 16, 2026
e475860
app: pass the Room run snapshot directly to ticket workers
AIFlowML Nov 16, 2026
480e0d3
changelog: #3514 under Unreleased
ashhart Nov 19, 2026
9858e8f
server: replies written as messages to recipients split into reasonin…
ajensenwaud Oct 25, 2026
e9662ca
server: recipient replies: a cut call is the reply's cut call, the pr…
ajensenwaud Oct 26, 2026
e97c96d
server: recipient replies: a streamed split reads only the bytes sinc…
ajensenwaud Oct 26, 2026
6c959be
server: recipient replies: a streamed message holds its trailing whit…
ajensenwaud Oct 27, 2026
c1e9398
server: the sampling-field flag reader moves to fields.zig
ajensenwaud Oct 27, 2026
6289c5a
server: move the late-system probe to keep server.zig within 600 lines
ashhart Nov 19, 2026
425f8aa
changelog: #1336 under Unreleased
ashhart Nov 19, 2026
2ead063
KV pool: host tier
BlivionIaG Oct 27, 2026
124c482
Validate host KV tier geometry before allocation
BlivionIaG Nov 4, 2026
c546da2
docs: reference the host KV tier PR in changelog
BlivionIaG Nov 6, 2026
34c68d1
docs: move host KV tier note to Unreleased
BlivionIaG Nov 6, 2026
431ed68
KV pool: notify the host tier when retired pages become reusable
ashhart Nov 19, 2026
ff195b2
changelog: #1501 under Unreleased
ashhart Nov 19, 2026
7ee5531
glm: resolve TF_NCCL_LIB in the shared NCCL library loader
vdalesandro Nov 13, 2026
80a8981
nccl: the TP session reads TF_NCCL_LIB by the loader's rule; nccl.zig…
vdalesandro Nov 14, 2026
ad8b547
changelog: #3106 under Unreleased
ashhart Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
102 changes: 100 additions & 2 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ These follow a model's release code or a library's model code for their math, ro
- `zig/src/vision/qwen_cuda.zig`: `Qwen3_5VisionModel` in transformers.
- `zig/src/core/picture/patches_test.zig`: recorded image-processor output data from `Lfm3VlImageProcessor` and `Qwen2VLImageProcessor` in transformers; the processing implementation is described below.
- `zig/src/families/flashnext/rotary_config.zig`: `_compute_yarn_parameters` in transformers, for the 64 rotary dims.
- `zig/kernels/metal/idol.metal`: the rounding points of Idol's denoiser in [speridlabs/idol-sdk](https://github.com/speridlabs/idol-sdk) at `4702a7f0`. Copyright speridlabs, Apache License 2.0; see [the license text](LICENSES/Apache-2.0.txt).

transformers is Copyright The HuggingFace Team, Apache License 2.0; see [the license text](LICENSES/Apache-2.0.txt).

Expand Down
4 changes: 2 additions & 2 deletions app/electron/agent/delegation-route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ async function run() {
// --- Source pins: both spawn paths route through the resolver ------------------------
{
const source = (rel: string) => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), 'utf8')
const roomIpc = source('../main/host/workspace-runtime-ipc.ts')
const roomIpc = source('../main/host/room-tools-runtime.ts')
const delegateStart = roomIpc.indexOf('delegate: async (args, seat)')
const delegateEnd = roomIpc.indexOf('read_file: async', delegateStart)
assert.ok(delegateStart >= 0 && delegateEnd > delegateStart, 'room delegate tool remains discoverable')
const delegate = roomIpc.slice(delegateStart, delegateEnd)
assert.match(delegate, /resolveDelegationRoute\(store\.settings\.providers/, 'room delegate resolves the cross-model route')
assert.match(delegate, /!routed\.route\) return `Cannot delegate:/, 'route errors surface as tool errors, not crashes')
assert.match(delegate, /runReadOnlySubAgent\(created\.agent, prov, routed\.route\.model/, 'room delegate runs the sub-agent on the routed model')
assert.match(delegate, /parent: parentForRoomSeat\(room, s\)/, 'delegated sub-agent lineage stays under the delegating seat')
assert.match(delegate, /parent: parentForRoomSeat\(runtimeScope\.room, s\)/, 'delegated sub-agent lineage stays under the delegating seat')

const threadRuntime = source('../main/host/tool-context-runtime.ts')
assert.match(threadRuntime, /resolveDelegationRoute\(store\.settings\.providers/, 'thread sub-agent launcher resolves the cross-model route')
Expand Down
9 changes: 7 additions & 2 deletions app/electron/agent/delegation-route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Provider, Seat } from './types'
import type { Provider, ReasoningEffortSetting, Seat } from './types'
import { resolveProviderModel, selectProviderAccount } from './provider-accounts'

// Cross-model delegation routing (Traycer-style): a single spawn binds provider/account/model,
Expand All @@ -10,6 +10,7 @@ export interface DelegationRouteBase {
// "fall back to the active/default account" while null means "no account".
providerAccountId?: string | null
model: string
reasoningEffort?: ReasoningEffortSetting
}

export interface DelegationRouteOverride {
Expand Down Expand Up @@ -49,10 +50,14 @@ export function resolveDelegationRoute(
const seat = seats?.find((candidate) => candidate.name === targetSeat)
if (!seat) return { error: `unknown seat "${targetSeat}"` }
route = { providerId: seat.providerId, providerAccountId: seat.providerAccountId, model: seat.model }
if (seat.reasoningEffort !== undefined) route.reasoningEffort = seat.reasoningEffort
}
// A same-provider override keeps the inherited account; only a cross-provider switch
// resets it (the account id is meaningless on the new provider).
if (providerId && providerId !== route.providerId) route = { providerId, model: route.model }
if (providerId && providerId !== route.providerId) {
route = { providerId, model: route.model,
...(route.reasoningEffort === undefined ? {} : { reasoningEffort: route.reasoningEffort }) }
}
const provider = providers.find((candidate) => candidate.id === route.providerId)
if (!provider) return { error: `unknown provider "${route.providerId}"` }
if (localOnly && provider.kind !== 'local') return { error: `provider "${provider.name}" must be a local provider for this local-only project` }
Expand Down
36 changes: 31 additions & 5 deletions app/electron/agent/engine/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,34 @@ const QWEN35: PinnedGeometry = {
linear_num_value_heads: 16,
linear_key_head_dim: 128,
linear_value_head_dim: 128,
linear_conv_kernel_dim: 6144,
linear_conv_kernel_dim: 4,
num_attention_heads: 8,
num_key_value_heads: 2,
head_dim: 256,
full_attention_interval: 4,
},
}

const QWEN27: PinnedGeometry = {
title: 'Qwen3.5 27B',
engineError: 'UnqualifiedQwenShape',
section: 'text_config',
dims: {
hidden_size: 5120,
vocab_size: 248320,
num_hidden_layers: 64,
intermediate_size: 17408,
linear_num_key_heads: 16,
linear_num_value_heads: 48,
linear_key_head_dim: 128,
linear_value_head_dim: 128,
linear_conv_kernel_dim: 4,
num_attention_heads: 24,
num_key_value_heads: 4,
head_dim: 256,
},
}

const LFM2_MOE: PinnedGeometry = {
title: 'LFM2.5',
engineError: 'UnsupportedLfmGeometry',
Expand Down Expand Up @@ -76,11 +96,15 @@ function layerTypesMatch(kind: string, layers: unknown): boolean {
}

export function admitGeometry(modelType: string, config: unknown): GeometryAdmission {
const pinned = PINNED[modelType]
if (!pinned) return { admitted: true, reason: null }
const defaultGeometry = PINNED[modelType]
if (!defaultGeometry) return { admitted: true, reason: null }
if (!plain(config)) return { admitted: true, reason: null }
const section = pinned.section ? config[pinned.section] : config
const section = defaultGeometry.section ? config[defaultGeometry.section] : config
if (!plain(section)) return { admitted: true, reason: null }
// The native dispatcher sends a tied head or the 2B hidden size to the 2B engine.
const useQwen27 = modelType === 'qwen3_5' && section.hidden_size === QWEN27.dims.hidden_size &&
config.hidden_size !== QWEN35.dims.hidden_size && config.tie_word_embeddings !== true && section.tie_word_embeddings !== true
const pinned = useQwen27 ? QWEN27 : defaultGeometry
for (const [key, expected] of Object.entries(pinned.dims)) {
const value = section[key]
if (value === undefined || value === null) continue
Expand All @@ -91,7 +115,9 @@ export function admitGeometry(modelType: string, config: unknown): GeometryAdmis
}
}
}
if (!layerTypesMatch(modelType, section.layer_types)) {
const interval = section.full_attention_interval
const wrongQwen27Interval = useQwen27 && typeof interval === 'number' && interval > 0 && interval !== 4
if (wrongQwen27Interval || !layerTypesMatch(modelType, section.layer_types)) {
return {
admitted: false,
reason: `This checkpoint's layer types are not the ones the bundled engine serves for ${pinned.title}; the engine refuses it (${pinned.engineError}).`,
Expand Down
61 changes: 60 additions & 1 deletion app/electron/agent/engine/library.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,23 @@ try {
await fs.writeFile(path.join(wrongGeometry, 'config.json'), JSON.stringify({ model_type: 'qwen3_5', quantization: { bits: 4, group_size: 64 }, max_position_embeddings: 32768, text_config: { hidden_size: 1024, num_hidden_layers: 24, vocab_size: 151936 } }))
const servedGeometry = path.join(modelsDir, 'served-geometry')
await checkpoint(servedGeometry)
await fs.writeFile(path.join(servedGeometry, 'config.json'), JSON.stringify({ model_type: 'qwen3_5', quantization: { bits: 4, group_size: 64 }, max_position_embeddings: 32768, text_config: { hidden_size: 2048, num_hidden_layers: 24, vocab_size: 248320, intermediate_size: 6144, linear_num_key_heads: 16, linear_num_value_heads: 16, linear_key_head_dim: 128, linear_value_head_dim: 128, linear_conv_kernel_dim: 6144, num_attention_heads: 8, num_key_value_heads: 2, head_dim: 256, full_attention_interval: 4 } }))
const servedConfig = {
model_type: 'qwen3_5',
quantization: { bits: 4, group_size: 64 },
max_position_embeddings: 32768,
text_config: {
hidden_size: 2048, num_hidden_layers: 24, vocab_size: 248320, intermediate_size: 6144,
linear_num_key_heads: 16, linear_num_value_heads: 16, linear_key_head_dim: 128, linear_value_head_dim: 128,
linear_conv_kernel_dim: 4, num_attention_heads: 8, num_key_value_heads: 2, head_dim: 256, full_attention_interval: 4,
},
}
await fs.writeFile(path.join(servedGeometry, 'config.json'), JSON.stringify(servedConfig))
const wrongConvolution = path.join(modelsDir, 'wrong-convolution')
await checkpoint(wrongConvolution)
await fs.writeFile(path.join(wrongConvolution, 'config.json'), JSON.stringify({
...servedConfig,
text_config: { ...servedConfig.text_config, linear_conv_kernel_dim: 6144 },
}))
const incomplete = path.join(modelsDir, 'incomplete')
await checkpoint(incomplete)
await fs.writeFile(path.join(incomplete, 'model.safetensors.index.json'), JSON.stringify({ weight_map: { a: 'model-00001-of-00002.safetensors', b: 'model-00002-of-00002.safetensors' } }))
Expand All @@ -111,6 +127,10 @@ try {
assert.match(refused.reason!, /hidden size is 1024/)
assert.match(refused.reason!, /UnsupportedQwenGeometry/)
assert.equal(selected.models.find((model) => model.path === servedGeometry)?.loadable, true, 'the geometry the engine serves stays offered')
const refusedConvolution = selected.models.find((model) => model.path === wrongConvolution)!
assert.equal(refusedConvolution.complete, true)
assert.equal(refusedConvolution.loadable, false)
assert.match(refusedConvolution.reason!, /linear conv kernel dim is 6144/)
assert.equal(selected.models.find((model) => model.path === foreign)?.complete, true)
assert.match(selected.models.find((model) => model.path === incomplete)!.reason!, /missing.*shards/)
assert.match(selected.models.find((model) => model.path === invalid)!.reason!, /safetensors/)
Expand Down Expand Up @@ -180,6 +200,45 @@ try {
const rescan = await lowMemory.scan()
assert.deepEqual(rescan.models.map((model: any) => [model.id, model.loadable, model.reason]), lowered.models.map((model: any) => [model.id, model.loadable, model.reason]), 'a later rescan agrees with the refreshed state')

const qwen27 = {
hidden_size: 5120, vocab_size: 248320, num_hidden_layers: 64, intermediate_size: 17408,
linear_num_key_heads: 16, linear_num_value_heads: 48, linear_key_head_dim: 128,
linear_value_head_dim: 128, linear_conv_kernel_dim: 4, num_attention_heads: 24,
num_key_value_heads: 4, head_dim: 256, full_attention_interval: 4,
}
const qwen27Library = library({ appHome: path.join(root, 'qwen27-app') })
const qwen27Models = path.join(root, 'qwen27-models')
const qwen27Cases = [
{ name: 'untied', tied: false, text: qwen27 },
{ name: 'wrong-kv-heads', tied: false, text: { ...qwen27, num_key_value_heads: 2 } },
{ name: 'wrong-interval', tied: false, text: { ...qwen27, full_attention_interval: 2 } },
{ name: 'tied-root', tied: true, text: qwen27 },
{ name: 'tied-tower', tied: false, text: { ...qwen27, tie_word_embeddings: true } },
]
for (const { name, tied, text } of qwen27Cases) {
const folder = path.join(qwen27Models, name)
await checkpoint(folder)
await fs.writeFile(path.join(folder, 'config.json'), JSON.stringify({
model_type: 'qwen3_5', tie_word_embeddings: tied, quantization: { bits: 4, group_size: 64 },
text_config: text,
}))
}
const qwen27Entries = (await qwen27Library.addFolder(qwen27Models)).models
const untied = qwen27Entries.find((model) => model.path === path.join(qwen27Models, 'untied'))!
assert.equal(untied.loadable, true, 'the qualified untied 27B is available in the library')
assert.equal((await qwen27Library.resolve(untied.id)).path, untied.path)
const wrongHeads = qwen27Entries.find((model) => model.path === path.join(qwen27Models, 'wrong-kv-heads'))!
assert.equal(wrongHeads.loadable, false)
assert.match(wrongHeads.reason!, /num key value heads is 2.*UnqualifiedQwenShape/)
const wrongInterval = qwen27Entries.find((model) => model.path === path.join(qwen27Models, 'wrong-interval'))!
assert.equal(wrongInterval.loadable, false)
assert.match(wrongInterval.reason!, /layer types/)
for (const name of ['tied-root', 'tied-tower']) {
const tied = qwen27Entries.find((model) => model.path === path.join(qwen27Models, name))!
assert.equal(tied.loadable, false)
assert.match(tied.reason!, /UnsupportedQwenGeometry/)
}

const validRegistry = await fs.readFile(lib.file, 'utf8')
await fs.writeFile(lib.file, '{')
await assert.rejects(() => library().snapshot(), /library is invalid/)
Expand Down
20 changes: 20 additions & 0 deletions app/electron/agent/room-delegation-effort.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import assert from 'node:assert/strict'
import { resolveDelegationRoute } from './delegation-route'
import type { Provider, Seat } from './types'

const provider: Provider = { id: 'fixture', name: 'Fixture', kind: 'local', apiKey: '',
baseUrl: 'http://127.0.0.1:1/v1', models: ['first', 'second'] }
const other: Provider = { ...provider, id: 'other' }
const base = { providerId: provider.id, model: 'first', reasoningEffort: 'low' as const }
const seats: Seat[] = [
{ id: 'reviewer', name: 'Reviewer', role: 'Review input', providerId: provider.id, model: 'second', reasoningEffort: 'high' },
{ id: 'legacy', name: 'Legacy', role: 'Review input', providerId: provider.id, model: 'first' },
]
assert.deepEqual(resolveDelegationRoute([provider, other], base, {}).route, base)
assert.deepEqual(resolveDelegationRoute([provider, other], base, { targetSeat: 'Reviewer' }, seats).route,
{ providerId: provider.id, providerAccountId: undefined, model: 'second', reasoningEffort: 'high' })
assert.deepEqual(resolveDelegationRoute([provider, other], base, { targetSeat: 'Legacy' }, seats).route,
{ providerId: provider.id, providerAccountId: undefined, model: 'first' }, 'an inherited target does not adopt the origin agent override')
assert.deepEqual(resolveDelegationRoute([provider, other], base, { providerId: other.id, model: 'second' }).route,
{ providerId: other.id, model: 'second', reasoningEffort: 'low' }, 'explicit provider changes retain the originating effort')
console.log('Room delegation effort routing checks passed: origin, target agent, legacy target and explicit provider/model route.')
97 changes: 97 additions & 0 deletions app/electron/agent/room-heartbeats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import type { RoomDeliberationEffort, Seat, SeatHeartbeat } from './types'

// Minimal shape the heartbeat helpers need — lets tests exercise stall detection
// without standing up a full SeatRuntime (messages/recent are irrelevant here).
export interface SeatRuntimeLike {
seat: Pick<Seat, 'id' | 'name'>
heartbeat: SeatHeartbeat
}

// Default grace after nextDueAt before a slow seat is flagged stalled (BUG #53).
// Tolerates transient model latency so a normal slow turn does not false-positive.
const SEAT_STALL_GRACE_SECONDS = 30

// Heartbeat cadence derived from the room deliberation effort. Deeper sessions
// expect longer per-turn thinking, so we widen the interval to avoid false stalls.
export function seatHeartbeatIntervalSeconds(effort?: RoomDeliberationEffort | null): number {
switch (effort) {
case 'quick': return 30
case 'deep': return 90
case 'max': return 120
case 'normal':
default: return 60
}
}

// Seed a healthy heartbeat for a seat at room start.
export function initSeatHeartbeat(seat: Pick<Seat, 'id' | 'name'>, intervalSeconds: number, now: number): SeatHeartbeat {
return {
seatId: seat.id,
seatName: seat.name,
intervalSeconds,
stallGraceSeconds: SEAT_STALL_GRACE_SECONDS,
required: true,
count: 0,
lastBeatAt: now,
nextDueAt: now + intervalSeconds * 1000,
missedSince: null,
}
}

// Record that a seat produced a turn: bump count, advance the clock, clear any stall.
export function recordSeatBeat(hb: SeatHeartbeat, now: number): void {
hb.count++
hb.lastBeatAt = now
hb.nextDueAt = hb.required ? now + hb.intervalSeconds * 1000 : null
hb.missedSince = null
}

// Names of seats currently flagged stalled (missedSince set), excluding one seat
// by name (the seat trying to FINAL is obviously alive). Used to block a premature
// finalize while a teammate is hung (BUG #53).
export function stalledSeatNames(runtimes: SeatRuntimeLike[], exclude?: string): string[] {
return runtimes
.filter((rt) => rt.heartbeat.required && rt.heartbeat.missedSince != null && rt.seat.name !== exclude)
.map((rt) => rt.seat.name)
}

// Re-arm the stall window for seats that actually took a turn in the previous pass.
// A single pass over several slow models can take longer than interval+grace, so a
// seat that beat last pass and is merely waiting its turn must not be false-flagged;
// pushing its nextDueAt forward to this pass start prevents that. Crucially, seats
// that did NOT run last pass (e.g. one that keeps timing out without ever calling
// recordSeatBeat, or any seat on the very first pass) are left untouched so their
// window keeps counting and evaluateSeatHeartbeats can actually flag a real stall —
// re-arming every non-stalled seat unconditionally is what made stall detection dead
// code (BUG #53 regression).
export function rearmSeatHeartbeats(
runtimes: SeatRuntimeLike[],
ranLastPass: Set<string>,
passStart: number,
): void {
for (const rt of runtimes) {
const hb = rt.heartbeat
if (hb.required && hb.missedSince == null && ranLastPass.has(rt.seat.id)) {
hb.nextDueAt = passStart + hb.intervalSeconds * 1000
}
}
}

// Detect seats whose turn is overdue past the grace window. Mutates each newly
// stalled heartbeat's missedSince so a stall is reported once (not every tick),
// and returns human-readable notices for the moderator to surface.
export function evaluateSeatHeartbeats(runtimes: SeatRuntimeLike[], now: number): string[] {
const stalled: string[] = []
for (const rt of runtimes) {
const hb = rt.heartbeat
if (!hb.required || hb.lastBeatAt == null || hb.nextDueAt == null) continue
if (hb.missedSince != null) continue // already flagged; do not re-report
const stallAt = hb.nextDueAt + hb.stallGraceSeconds * 1000
if (now >= stallAt) {
hb.missedSince = hb.nextDueAt
const ago = Math.round((now - hb.lastBeatAt) / 1000)
stalled.push(`Seat "${rt.seat.name}": heartbeat overdue (last beat ${ago}s ago)`)
}
}
return stalled
}
Loading