Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(chat): first chats fail with Agent error while Local AI is starting This is item 1/1 in the current shard. Shard 0/1. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
def6ddd to
9c2795c
Compare
|
I would generalize it to check a generic inference known back-end controlled by the node app rather to only local AI if possible. |
| TimeSpan timeout) | ||
| { | ||
| /// <summary>Upper bound for holding one send; the send proceeds afterwards either way.</summary> | ||
| internal static readonly TimeSpan DefaultTimeout = TimeSpan.FromMinutes(2); |
There was a problem hiding this comment.
I would do an env variable with a default constant.
There was a problem hiding this comment.
Done in 9ba1602: OPENCLAW_CHAT_SEND_HOLD_TIMEOUT_SECONDS (a positive whole number of seconds) overrides ChatSendReadiness.DefaultTimeout, which stays at two minutes. Any other value falls back to the default. Covered by the ResolveTimeout_* tests.
9c2795c to
3a11c63
Compare
|
@larroy thanks, done in 9ba1602. The hold now goes through a small |
|
@larroy confirm it looks good to you now? |
|
I would like to hold off on merging this. I'm redoing the fix to be more robust. |
196d729 to
673c1dd
Compare
|
@larroy I replaced the chat-side send hold with a fix at the source in 673c1dd. Startup now keeps the Gateway's @clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs changes before merge. What this changesThis PR queues native chat sends while their required model is unavailable and exposes queue status through MCP. Example: Send “Reply with exactly: AFTER7-OK #1” while the llamacpp default route is withdrawn during startup.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Needs changes before merge - 3 items remain Keep open: the startup hold demonstrably works, but rejection handling still permits stale holds and premature dispatch across sessions. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherNative UI and MCP submissions enter the chat provider, which coordinates session selections and outgoing queues before dispatching chat.send through the Gateway connection. flowchart LR
UI[Native chat UI] --> Provider[Chat data provider]
MCP[Local MCP] --> Provider
Provider --> Readiness[Gateway model readiness]
Provider --> Queue[Conversation queue state]
Readiness --> Gateway[Gateway connection]
Queue --> Gateway
Gateway --> Model[Inference provider]
Technical reviewBest possible solution: Correlate model-patch outcomes per request and commit model selection, readiness invalidation, and queue admission through ChatConversationState. Do we have a high-confidence way to reproduce the issue? The supplied current-main screenshot and correlated Gateway logs establish the startup failure; the rejection defects are source-reproducible interleavings, not locally executed reproductions. Is this the best way to solve the issue? Queueing through the existing send path is useful and preserves safe route withdrawal, but model outcomes and readiness must share the established transaction boundary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 127016568ef2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (7 earlier review cycles)
Reviewed October 16, 2026, 7:03 AM ET / 11:03 UTC (Revision 8). |
|
checking... |
673c1dd to
030178b
Compare
|
Both P1 findings on 673c1dd were valid, so that approach is gone. 030178b takes a different route:
Checked against the real Gateway @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
21d0b7a to
8480656
Compare
|
@clawsweeper re-review Addressed the three findings in
Validation on |
|
🦞👀 Re-review progress:
|
9ee462c to
0c8210d
Compare
|
@clawsweeper re-review Addressed "Settle model selection before deciding send readiness" in
Validation on |
|
🦞👀 Re-review progress:
|
Companion Local AI startup and restarts withdraw the Gateway's llama.cpp provider until llama-server answers, about 30 s on an RTX Spark. A chat sent in that window fails as an unknown model, and the user sees a generic "Agent error" (openclaw#1445). Before each send, check the Gateway's configured model list for the model it tags as default. While it is missing, admit new messages to the send queue and re-check every second, then drain the queue once it is listed, for at most two minutes. The composer stays usable, and the existing queue rules for cancel, failed-send retry, reconnect and ordering apply to held messages. Anything the check cannot tell, such as no connection or an older Gateway without model tags, sends as before. MCP app.chat.send reports whether the message is queued. Co-Authored-By: Claude Opus 5.5 <[email protected]>
0c8210d to
e5c2d73
Compare
|
@clawsweeper re-review Addressed "Use confirmed model-patch outcomes for readiness tracking" in
Validation on |
|
🦞👀 Re-review progress:
|
|
Status update on the chat send hold for #1445 (PR #1738): The fix needs more work, but it is a working option. On Windows ARM64 with the WSL Gateway, a chat sent while companion Local AI restarts is held until the Gateway lists its default model again (about 20-25 s), then answered, instead of failing with "This model was not found". Before/after screenshots and logs are in the PR description. What still needs work:
If QA considers #1445 a show stopper, we can merge this as is and follow up on the items above. Otherwise the PR stays open while a cleaner fix is worked out. |
|
Hi @joelagnel, I'm a GitHub Copilot triage bot helping with repository housekeeping, not Scott. Thanks for the clear October 16 update and the device evidence. Is the cleaner Local AI startup fix you mentioned still moving forward, and should this draft be updated against current main? If the approach has moved to another PR or you're no longer pursuing this version, you're welcome to close it with a pointer. If it's still intentionally parked, a short status note is enough. No rush, and I won't close it automatically. |
|
This issue is still open but I am not going to get time to work on this bug. The PR is experimental and not in a mergeable state. I’m happy to hand this PR to anyone else who wants to take it further. The issue is still open AFAIK. |
PR cleanup reviewReviewed head: Thanks for documenting both the working startup case and the remaining limits. I rechecked e5c2d73 against main e59374c: the hold is not superseded, but rejected-patch admission and cross-session invalidation races remain, and readiness state sits outside the conversation owner. Given your November 7 handoff note, this should remain a nonmergeable draft until a maintainer takes a focused repair through regression tests and current-head proof. The green older-base CI does not clear those races. Action in this cleanup pass: leaving this PR open. No branch changes or runtime-proof waiver. The findings above come from source, discussion and recorded-CI review; Windows validation was not rerun in this pass. |
|
This pull request has been automatically marked as stale due to inactivity. |
Closes #1445
What Problem This Solves
Fixes: the first chats after the companion starts (including the post-setup restart) fail with a generic Agent error when Local AI is the model.
User Impact
User impact: a chat sent while the Gateway cannot resolve its default model (for example while companion Local AI is restarting) now waits in the outgoing queue and gets a reply once the model is back, instead of failing. The composer stays usable, and a held message can be canceled from its queue card. When the default model is listed, sends go out immediately as before.
Why This Change Was Made
Companion Local AI startup withdraws the Gateway's
models.providers.llamacpproute and publishes it again only after llama-server answers (about 30 s on an RTX Spark). A turn sent in that window fails withUnknown model: llamacpp/<alias>(model_not_found), which the Gateway does not retry. Root-cause logs are on #1445.Each chat send now checks the inference endpoint the turn will use, as seen by the Gateway itself:
models.list(view: "configured") and looks for the entry taggeddefault. While the llamacpp route is withdrawn, that entry is gone from the list.sessions.listhas had 30 s to reflect it. A switch the Gateway rejects, or whose request throws, is dropped, and held sessions are re-checked so a hold caused only by a rejected switch is released. Holds are tracked per session, so one session's hold never delays another session's queue.models.listawait. Wait state is fenced by operator client: a previous client's wait cannot change what the new client's sends see.models.listreply does not start a hold (sends behave as onmain), and does not end a running one early. An older Gateway that does not tag models counts as listed.MCP:
app.chat.sendnow also returnsqueued, so automation can tell a message waiting in the outgoing queue from one that was dispatched. The tool description and.agents/skills/winnode/SKILL.mdare updated. Ledger: a new authoritative row indocs/ARCHITECTURE.md.Why not fix it where the route is withdrawn. Keeping the route on the last port lets a local process squat the unowned port (ClawSweeper P1). Parking the provider at
127.0.0.1:0is safe, but the Gateway binds a turn'sbaseUrlonce and its retries never re-read it, so in-flight turns still fail (proven on Gateway2026.10.3).Known limits:
models.listround trip (2 s timeout).Evidence
Same single-send race on both builds: restart the companion, open chat, and send one message about 10 s after the composer appears (inside the route withdrawal).
main(Dev2026.9.804.4281)e5c2d736, Dev2026.9.804.4306)BEFORE3-OK #1fails with Agent errorAFTER7-OK #1is held, then answeredChange Type
Scope
Required proof pools
windows-11-arm64: the reproduction and proof run on Windows ARM64 (RTX Spark N1X) with the packaged Dev app.windows-wsl-dgx-blackwell: Local AI startup and real inference through the WSL Gateway on Blackwell.Validation
Run on Windows ARM64 (RTX Spark,
rtxspark2), worktree ate5c2d736:./build.ps1dotnet test tests/OpenClaw.Shared.Testsdotnet test tests/OpenClaw.Tray.Testsdotnet test tests/OpenClaw.WinNode.Cli.TestsCI classifies this diff as
targeted, so it does not build a Dev MSIX. The proof package was built on rtxspark2 from the same worktree with./build.ps1 -Project WinUI -Configuration Release -Msix Dev(the CI Dev signing path), and was installed as an in-place upgrade of the CI Dev package.Real Behavior Proof
Windows ARM64 (RTX Spark N1X), WSL Gateway
2026.10.3, companion-managed Local AI (llama.cpp b11320, Qwen3.6-35B-A3B Q4_K_S). The UI was driven with UI Automation.After (this PR at
e5c2d736, Dev2026.9.804.4306). Companion log (local time):Unknown modelentry for this run.AFTER7-OK #1fromqwen3.6-35b-a3b-mtp-ud-q4-k-s(screenshot above).Before (
main, Dev2026.9.804.4281), the same race:The chat shows Agent error (screenshot above).
Not verified:
app.chat.sendreturningqueued: trueduring this hold was not re-run on this head. It was proven during a hold on an earlier head of this PR (9ba1602d), and thequeuedplumbing is unchanged.Security Impact
models.listrequests on the existing operator connection.Compatibility and Migration
🤖 Generated with Claude Code