Repository navigation
fix: fail a Room Run that never replied, Local models page copy and feedback, attachment limit, gateway-home cause (0.1.4) - #249
Conversation
A Pi Run on a small local model often answers in its final text without calling the message command. The Run then succeeded and the Room showed nothing. A Room Run that never tried to post while a Human's Message that mentioned the Agent waits now finishes failed with reply_not_sent, so the Room shows the cause. The final text stays private scratch and is not posted for the Agent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make room said a model "doesn't fit even when the memory is empty" whenever no other model was loaded in its pool, though on a shared card other apps or Linger's components held the memory. It now says a model can't fit only when it needs more than the pool's total; otherwise, when unloading every loaded model is not enough, it lists what else holds the pool (components, and other apps from the used bytes no holder accounts for) and asks to close other apps. A cancel, unload or remove under way now labels its row Cancelling, Unloading or Removing (Discarding for a stopped download) until a snapshot moves the model on, and a download the Computer accepted can be cancelled before its first progress reaches a snapshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An oversized Message attachment showed "message attachment exceeds the configured limit" with no number. TeamHub now adds an ErrorDetail with code too_large and the new limit_bytes field to its PAYLOAD_TOO_LARGE answer, and the composer reads that structured limit to say how large attachments may be and how large the file is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
localmodels 0.1.0.dev40 adds cause GATEWAY_HOME_NOT_PRIVATE and the folder's path to a GATEWAY_REGISTRATION_FAILED error line, while its status row keeps only the code. LocalModelError gains optional cause and path in the Runner Gateway and TeamHub contracts. The Daemon keeps the cause of a job's error line per model and puts it back on that row in every read while it still fails with that code; the model's next accepted job drops it. TeamHub refuses an unknown cause and shows the path only to the Computer's owner, and the Local models page tells the owner to quit Linger and rename that folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Request changes (1 P1, 1 P3)
Scope: base main, merge base 71b42436 (equal to current origin/main, so the branch is not behind). Reviewed 4 commits and 41 files at 62551304. Loaded coderbook (sections 2, 3, 5), ponytail-review (sections 1–3) and karpathy-guidelines (sections 2–3). Ran in a separate session.
Findings
P1
1. A reply sent from a chained shell command still fails the Run with reply_not_sent. (apps/node-services/src/agent/executor/reply-delivery.ts:27, :59)
replyNotSent counts a write only when the Computer reports an activity.started with kind === "message". The Computer gives a whole shell script one kind. activityPresentation (apps/computer/local-daemon/internal/provider/activity_status.go:47-52) takes that kind from the last shown step. A message send is a quiet step (command_activity.go:378), so any other recognized command in the same script decides the kind. I checked this against activityPresentation with a temporary probe test, which I then deleted:
python3 make_chart.py && teamhub message send --attach chart.png --content 'Here it is'gets kindcommandteamhub docs create --title Plan --file plan.md && teamhub message send --content 'Plan is in the doc'gets kindfile_change
Failure scenario: a Human @-mentions the Agent. The Agent builds a file or Document and sends the reply in the same shell call, which the compact prompt encourages ("Once a message is owed, send it in the same step"). The message posts and the Room shows it, but #attemptedWrites stays 0. The Run then finishes failed with reply_not_sent, and the Room also shows the red "The Agent finished without sending its reply…" failure under a visible reply. Before this PR the same Run succeeded. This contradicts the stated design that a Run fails only when the Agent "never started a message write". It also breaks the real-machine expectation of "either a visible reply or the red Run failure". Codex and Claude Code chain commands routinely, so check 6 in the test plan (no reply_not_sent for those runtimes) is likely to fail in practice.
Fix: record that a script contains a message send without depending on which step's kind wins. Two ways:
- Have the Computer emit
messagewhenever any step of the script is a message send. The status line can still show the other steps. - Carry a separate structured flag on the activity.
Either way, add activity_status_test.go cases for the two commands above. Add a run-loop test where a mentioned Human's Run posts through a mixed-kind activity and must succeed. A server-side alternative is to check in TeamHub whether the Agent authored a Message in the Room during the Run. That would also make this independent of the shell parser.
P3
2. awaitsReply adds a fourth ad-hoc parser of acceptedNotification.messages. (apps/node-services/src/agent/executor/reply-delivery.ts:85-97)
run-kind.ts:14-36 (messageRunKind / inputRunKinds) already classifies each queued Message by authorType and messageKind. accepted-fact.ts and accepted-notification.ts parse the same payload too. The new check uses a slightly different rule: it requires messageKind === "conversation", while run-kind treats every non-agent_runtime/task_terminal_notice Human message as chat. Export one helper from run-kind.ts, for example "Human chat message that mentioned the Agent", and use it here, so the two rules can't drift apart.
Verified as fine
- Mentions are deterministic:
mentioned,authorTypeandmessageKindcome from TeamHub's frozen inbox payload (agent_inbox_notification_payloadin00852_baseline.sql). No wording is matched. - Steers are observed only after
provider.steersucceeds (run-loop.ts#applyProviderSteer).reply_undeliveredstill takes precedence overreply_not_sent. - The enum is added consistently in node-services
provider.ts, the TeamHub validator (runtime_failure.go), the contract, the generated code and the Web copy. Docs are updated inapps/node-services/src/agent/AGENTS.md,apps/web/AGENTS.mdand the local-daemon README. - Daemon cause tracking:
restoreCausestakesl.muitself, andreadis not called under it.- An accepted job clears the cause, and a row that moved on or changed code drops it.
- The path is clipped to the schema's 4096 characters, and only known causes are kept.
- TeamHub:
localModelsViewstripspathfor non-owners, and that view is the only public reader of the snapshot.- An unknown cause is rejected at record time.
- The 413 detail uses
writeErrorWithDetails, andlimit_bytesis an additive optional field.
- Web:
- The attachment copy reads
limit_bytesfrom structured details (formatBytesrenders 52428800 as "50 MB") and falls back to the server message otherwise. - The Make room
keptlist excludes the loaded models the user can unload. tooBiguses the pool total.- The early-Cancel
busyrule frees only an accepted, no-longer-sending download.
- The attachment copy reads
- Rollout: the new Daemon to an old TeamHub/Agent Service rejects only snapshots that carry a cause, and the PR's Merge Danger section says so.
Process notes
- No merge commits and no fixup commits. All four commits are linked to GitHub user
oldwinter90.
CI
- All finished checks pass.
check (teamhub)was still pending at review time. - CI has no node-services job. I ran
vitest run tests/agent/executor/run-loop.test.ts -t "Room reply delivery"locally: 10 passed. That suite has no case for a reply sent in a chained command (finding 1). - I ran a throwaway
activityPresentationprobe ininternal/provider(deleted afterwards) to confirm the kinds quoted in finding 1.
Automated review by Claude Code
Automated review of 6255130 by Claude Code.
There was a problem hiding this comment.
Request changes (1 P1 and 1 P3 carried over from the previous review; no new findings)
Scope: follow-up on 6255130. Base main, merge base 71b42436, 4 commits and 41 files. The PR head is still 62551304, the same commit the previous review covered, so git diff 6255130..HEAD is empty and there was nothing new to review. I re-checked the two earlier findings against the code at this head. Helper skills (coderbook, ponytail-review, karpathy-guidelines) were not reloaded because no code changed since the last review. This ran in a separate session.
Previous findings
- P1: a reply sent by a chained command is still reported as
reply_not_sent. Not resolved.apps/computer/local-daemon/internal/provider/activity_status.go:47-52still sets a shell script's activity kind from its last shown step.command_activity.go:378marksteamhub message sendandteamhub message emojiasquiet, so they drop out of the shown steps.- So a script like
python3 draft.py && teamhub message send --file reply.mdgets the kindcommand. A script liketeamhub message read --json && teamhub message send --content higets the kindmessage_read. ReplyDelivery.observe(apps/node-services/src/agent/executor/reply-delivery.ts:27) counts an attempted write only when the kind ismessage. A Human who mentioned the Agent gets the reply, and the Run still fails with "The Agent finished without sending its reply to the Room".- Fix: give a script that contains a message send a write kind, or a separate write flag on the activity, whatever its last shown step is. Then add a run-loop test for a chained send.
- P3:
awaitsReplyparses the Inbox payload a second time. Not resolved.reply-delivery.ts:85-97still readsacceptedNotification.messages[].{mentioned, authorType, messageKind}by hand.messageRunKindinapps/node-services/src/agent/executor/run-kind.ts:14already classifies the same queued-message origin. Reusing it would keep the two rules from drifting apart.
Findings
None new. The head did not change.
Verified as fine
- The head SHA matches the previous review, and there are no merge commits in
71b42436..62551304. - The quiet-step kind resolution and the
message-only write counting are still in the state the earlier P1 describes.
Process notes
- No new commits since the previous review. The P1 above needs a code change before merge.
CI
All reported checks pass: computer-go, contracts, desktop, installer, packages, teamhub, teamhub-cli, web, the three web test shards, web-static, repository-gate and CodeQL. I ran no tests locally; the head did not change and the finding was confirmed by reading the code. Merge state is BLOCKED, which waits on review.
Automated review by Claude Code
Automated review of 6255130 by Claude Code.
Computers, Agent replies and the Local models page for 0.1.4. This PR consolidates #230 and #237, replayed on the newest main with authorship and messages kept, one commit per concern:
fix(agent): fail a Room Run that never replied to a waiting Humanreply_not_sent(node-services, TeamHub validator, web copy, contract enum)fix(web): explain Make room and show local model actions under wayfix: name the attachment size limit when TeamHub refuses a filefeat: show why a local model's gateway registration failedLocalModelErrorcause and path, Daemon to Web#229 (C1, Set Up Again keeps the Computer) is not in this PR: main already has #234, which fixes the same problem (#97) differently. The parts of #229 that #234 does not cover are tracked in #243.
Integration changes
poolOtherBytes(fix: Local models page copy and feedback, attachment limit, gateway-home cause (0.1.4 E2) #237's duplicateotherAppsByteshelper andLoadCheck.otherAppsBytesfield are dropped), adds fix: Local models page copy and feedback, attachment limit, gateway-home cause (0.1.4 E2) #237's "Also using this memory" list and its "needs more than all of the pool" case, and asks to close other apps and click Recheck memory. fix: Local models page copy and feedback, attachment limit, gateway-home cause (0.1.4 E2) #237's three Make room tests are updated to that copy; feat(local-models): add memory cleanup guidance, live recheck, and model activation #242's tests pass unchanged. Details in Part 2 below.renderPageasync; fix: Local models page copy and feedback, attachment limit, gateway-home cause (0.1.4 E2) #237's new tests now await it (no-floating-promises).pnpm contracts:verifypasses. No migration.User message →
provider_readypath: untouched. Neither part adds a network round trip or file walk there.Integration checks on this branch (
BASE=origin/main, GOROOT/GOBIN unset)make check-repository-gate: passes.make -C apps/teamhub fmt-check lint-go,go test ./tests/integration/layout: pass.pnpm --filter @linger/web test src/features/local-models: 72 passed.make check: check-repository, check-docs, check-contracts, check-voice-runtime, check-teamhub-cli, check-installer, check-desktop, check-teamhub and check-scripts-fast pass. check-packages failed innative-process.test.ts(this PR does not touch that package; host load average ~130). rerun on their own: check-web and check-node-services pass; check-computer passes exceptTestManagedToolsUpdateKeepsResidentDaemonPID, which fails the same way on an unmodified main on this host (it needs the bundled Node 26.5 layout). CI passes every required check, check (packages) and check (computer-go) included.Part 1: fail a Room Run that never replied to a waiting Human (from #230)
Problem (P1-7, #172)
Pi on a small local model often answers in the Run's final text without calling
teamhub message send. The Run reportedsucceededand the Room showed nothing: no reply and no failure.Root cause:
ReplyDelivery.replyUndelivered(apps/node-services/src/agent/executor/reply-delivery.ts) failed a Room Run only when it tried to post and every write failed. An Agent that never tried was treated as choosing silence, so#completedTerminalinrun-loop.tsreturnedsucceeded. Silence is correct for Room talk the Agent only reads along with, but not when a Human mentioned it and is waiting.Fix
A Room (Meta) Run now finishes failed with the new code
reply_not_sentwhen both are true:mentioned,authorType == "user", andmessageKind == "conversation". The web sends every direct-chat message with the peer's @mention, so direct chats are covered.Routine wakes, Task callbacks, another Agent's mention, and Room talk that doesn't mention the Agent can still end silently. No wording is matched anywhere.
The final text is not posted on the Agent's behalf. The prompt defines it as private scratch, which often holds reasoning about whether to reply, and node-services has no server-side post path. The Room shows the failure instead: "Pi: The Agent finished without sending its reply to the Room. Its model may have answered without using the message command. Ask again, or choose a stronger model for the Agent."
apps/node-services/src/agent/executor/reply-delivery.ts:observeInputs,replyNotSent,awaitsReplyapps/node-services/src/agent/executor/run-loop.ts:#completedTerminalreturnsreply_not_sentand logslocal_run.reply_not_sent. Steered inputs are observed in#applyProviderSteer.contracts/openapi/components/agent-runtime-state.yaml(regenerated)apps/teamhub/internal/agentruntimestate/runtime_failure.goapps/web/src/features/rooms/runtime-status/runtime-failure-message.tsapps/node-services/src/agent/AGENTS.mdCritical path (user message →
provider_ready): no change. The check runs after the Provider turn completes and adds no network round trip or file walk.Not in this PR
skipin the Inbox disposition, and a failed Run is not replayed. The loop looks like model behavior inside one Runtime turn, and that needs the real-machine check below before adding a per-Run budget or duplicate guard.Tests
Written first. Both "posted nothing" cases came back
succeededbefore the fix.apps/node-services/tests/agent/executor/run-loop.test.ts› Room reply delivery:reply_not_sent, the final text stays out of the terminal, andlocal_run.reply_not_sentis logged.reply_not_sent.runtime_failure_test.go:reply_not_sentis accepted.runtime-failure-message.test.ts: copy forreply_not_sent.Checks run locally:
make check-node-services(260 files, 2622 tests)make check-webmake -C apps/teamhub fmt-check,go test ./tests/integration/layout,make -C apps/teamhub testpnpm contracts:verifymake check-repository-gate BASE=origin/mainmake check BASE=origin/mainalso selects check-packages and check-computer because the generated contracts changed. check-packages passes once mise's exportedGOROOT/GOBINare unset.TestManagedToolsUpdateKeepsResidentDaemonPID("Managed tools require Node 26.5.0") fails on this host on an unmodified origin/main too, so it isn't caused by this change.Real-machine checks (FIXLIST section 6, item 5; 0.1.4 RC round)
macOS (macmini, zh-CN, 24 GB), Pi with Spark-X2.6 4B, then again with LFM3 1.7B:
local_run.reply_not_sentevent withdeliveredMessageWrites: 0.reply_not_sentappears (regression check).Part 2: Local models page copy and feedback, attachment limit, gateway-home cause (from #237)
Summary
0.1.4 E2 (FIXLIST P2-11, P2-18; GitHub #183): Local models page copy and action feedback, the attachment size limit, and the localmodels dev40
GATEWAY_HOME_NOT_PRIVATEcause end to end. Three commits, each with its own regenerated contracts.1. Make room lists what holds the memory (
local-model-dialogs.tsx,local-models-rules.ts)Integrated with #242, which landed first and added the Recheck memory button and "Other apps are using N" copy to the same dialog. The dialog keeps #242's Recheck memory flow, "Enough memory is free now" state and
poolOtherBytes, and adds:2. Show actions that are under way (
local-model-row.tsx,local-models-page.tsx)3. Attachment limit names the number (TeamHub
handlers_message_attachment.go,use-composer-attachments.ts)4. GATEWAY_HOME_NOT_PRIVATE reaches the page
sequenceDiagram participant LM as localmodels dev40 participant D as Daemon (internal/localmodels) participant NS as Agent Service participant TH as TeamHub participant W as Web LM->>D: load job error line {code GATEWAY_REGISTRATION_FAILED, cause, path} Note over D: keeps cause per model; library status has only code+detail D->>NS: snapshot, row error + cause/path (each read, while the row still fails with that code) NS->>TH: record (envelope schema validates cause enum) TH->>W: view; path only for the Computer owner, unknown cause refused W->>W: "…the folder <path> belongs to another account. Quit Linger, rename that folder, then open Linger and load the model again."The owner's next accepted job for that model drops the kept cause, as does a row that has moved on. The cause lives in Daemon memory, so after a Daemon restart the row shows only the code copy. Contract changes are additive:
LocalModelError.causeandpathin both the Runner Gateway envelope and OpenAPI.Docs:
apps/web/AGENTS.md(labels, early Cancel, Make room) andapps/computer/local-daemon/README.md(error causes).Not in this PR: an unload or remove refusal that carries the cause still maps to
LOCAL_MODEL_ACTION_FAILED, because the cause reaches the page only through a failed load's row. "Recommended jumps rows mid-download" (precheck N1) is also not covered.User message →
provider_readypath: untouched. This PR adds no round trip or file walk there.Evidence
Every behavior test below failed first, before its implementation:
local-models-page.test.tsx)Downloading · 32%before and readsCancellingafterUnloadingmessage-composer.test.tsx): "names the file's size and the attachment limit when TeamHub refuses a large file"TestMessageAttachmentTooLargeNamesTheLimitcovers both the file-size path and the MaxBytesReader pathTestLocalModelsViewShowsTheCausePathOnlyToTheOwnerTestValidLocalModelsSnapshot/unknown error causeTestAFailedLoadKeepsTheGatewayCauseOnItsRowshows the cause on the failed row, keeps it across later reads, and drops it after a retry that fails without oneChecks run locally on this branch:
make check BASE=origin/mainpassed except one test,cmd/linger-computer-daemonTestManagedToolsUpdateKeepsResidentDaemonPID("Managed tools require Node 26.5.0"). It fails the same way on a clean origin/main worktree on this host, so it is environmental and not caused by this branch. The rest of check-computer passed when run separately:internal/provider/nativeand the go-local-daemon-process test.make check-repository-gate BASE=origin/mainpassed.fmt-checkandtests/integration/layoutpassed.Real-machine checks for the 0.1.4 RC round
gateway-homeowned by another account that localmodels cannot reclaim (for example SYSTEM, not Administrators), then Load. The owner's row details show the folder path and the rename instruction. Another Tenant member sees the copy without the path.Merge Danger
Door: two-way
The contract fields are optional and additive, and there is no migration or stored-data change. A revert drops the fields again, and snapshots already stored keep decoding.
Blast Radius: small
The changes are limited to the Local models page copy and row labels, one TeamHub 413 body (one new detail added), and Daemon snapshots, which can now carry
cause/pathon a failed row. Older TeamHub or Agent Service builds that receive a dev40 Daemon snapshot with a cause would reject it under the old envelope schema, so ship the Daemon with this TeamHub and Agent Service, as the desktop bundle already does.🤖 Generated with Claude Code