Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Commits on main

fix(approval): revalidate the thread route after the durable lookup\n\n`parked_request_for_thread` read the thread→request route, then called\n`list_pending` — a store read — without holding the route lock. In that window\na caller-bound abandon can clear the route, or a replacement turn can park a\nnew approval on the same thread and overwrite it (#4774's scenario), while the\noriginal row is still pending. The lookup would then return a row that is no\nlonger the thread's, and its only caller replays what it gets straight onto the\nuser's screen, so a stale row here is a stale approval card.\n\nRe-read the route after the lookup and answer only if it still names the same\nrequest. Raised by @coderabbitai in review.\n\nNarrowing, not closing, and the comment says so: the row can still be decided\nafter the check. That is the pre-existing fire-and-forget property of the\nreplay path, covered on the client by `request_id` idempotency — this only\nstops the lookup from starting with a row it can already tell is not the\nthread's.\n\nNo test. `list_pending` resolves through `store::list_pending(&self.config)`\nrather than an injectable seam, so nothing can force the interleaving, and\nevery reachable *state* is answered identically by both versions: with the\nroute cleared, the old code returns `None` from `pending_for_thread` before it\never reads the store. A state-based test here could not fail for the reason it\nexists, so one is not added.\n\nClaude-Session: https://claude.ai/code/session_01Fu3PXYSu3gV9u9kV6CwH1G\n
M3gA-Mind committed 2 months ago
c38bb01
fix(agent): fall back on a blank clarification question, and unblock the layout gate\n\nTwo follow-ups to the `ask_user_clarification` pause, both found after the\noriginal push.\n\n`{"question":""}` is a legal call — the schema has no `minLength` — and\n`as_str()` answers `Some("")`, which slipped past the missing-argument\nfallback. That was survivable only while `[CLARIFICATION NEEDED]` kept the\noutput non-empty. Now that this output *is* the message the user reads, an\nempty one parks the turn on a blank prompt: a blank assistant reply on the\nchannel path, the empty-output final-summary branch on the session path, and an\n`AwaitingUser` sub-agent card with nothing in it. So blank now counts as\nabsent, trimmed, and takes the same generic fallback a missing argument does.\nRaised by @chatgpt-codex-connector in review; a regression this branch\nintroduced by removing the marker.\n\n`Rust Quality` was red, and not on formatting — `Check Rust formatting`\npassed and `Enforce OpenHuman Rust file layout` failed:\n\n src/openhuman/agent/harness/session/turn/core_session.rs: 758 lines (limit 750)\n\nThe file was at 744 and the early-exit branch pushed it over. Split per the\nrepo's own `_part_NN.rs` convention (85 files already use it) rather than\ntrimming the reasoning to buy eight lines: part 01 is the turn driver, part 02\nthe context injection it calls, each a self-contained `impl Agent` block\nspliced into `core.rs` as before. No behaviour moves.\n\nBecause the layout step fails before clippy runs, neither clippy lane had\nexecuted on this branch at all. Both are now run and clean.\n\nClaude-Session: https://claude.ai/code/session_01Fu3PXYSu3gV9u9kV6CwH1G\n
M3gA-Mind committed 2 months ago
3ed99ec
342466b
fix(agent): actually ask the user on ask_user_clarification\n\nThe chat and channel turns both opted out of the early-exit pause, so\n`ask_user_clarification` answered its own question. Its output went back\nto the model as an ordinary successful tool result; the model read the\nquestion it had just written as answered and carried on. Users watched an\n"Ask User Clarification" step succeed without ever being asked anything.\n\nThe pause machinery already existed and already worked — but only for\ndelegated sub-agents (`subagent_runner/ops/graph_part_01.rs` names the\ntool in `early_exit_tools`, the runner returns `AwaitingUser`, and\n`AssistantUiSubagentCall` renders an answer box). The two top-level call\nsites passed `&[]`. The chat one carried a comment claiming the turn\n"surfaces clarifying questions inline"; nothing did, and nothing parsed\nthe `[CLARIFICATION NEEDED]` marker the tool emitted for that purpose\neither — grep finds no reader outside the tool's own test.\n\nName the tool in `early_exit_tools` on both paths. The seam then returns\nthe question as the turn's text and stops the loop, which is the whole\nmechanism at the top level: unlike a delegated child, a chat or channel\nturn's natural continuation IS the user's next message, so no resume\nplumbing or new UI is needed.\n\nTwo details that go with it:\n\n- Push the question into history on early exit. The run stops right after\n the tool round, so `outcome.conversation` ends on a tool result and\n carries no final assistant turn — the question is standing in for one.\n Without this the reply the user is looking at is missing from the next\n request's prefix. The sub-agent path makes the same substitution when\n it persists a paused child's transcript.\n\n- Drop the `[CLARIFICATION NEEDED]` prefix. The early-exit hook captures\n the tool's output verbatim as the pause question, so that marker was\n never machine-readable state — it was about to be shown to the user as\n the assistant's reply, and it already leaked onto the sub-agent card.\n\nTests: a scripted model calls the tool and then offers a second response,\n"built it without asking". Reverting the channel call site to `&[]` fails\nthe new test on that exact string, naming the assertion.\n\nBehaviour change worth noting: `run_channel_turn_via_graph` also serves\ncron/scheduled turns via `bus.rs`. One that calls this tool now ends on an\nunanswered question instead of inventing an answer and continuing.\n\nClaude-Session: https://claude.ai/code/session_016ipSkHi47nsBmnxX5dC4dA\n
M3gA-Mind committed 2 months ago
6c8fb18
fix(approval): replay a parked approval to a socket that joins the thread room\n\nA chat approval is durable server-side state — the gate holds the parked call\nand a `pending_approvals` row — but it reaches the UI as exactly ONE\nfire-and-forget socket emit, and nothing reconciles the two. Any single missed\ndelivery strands the turn: the core stays parked, the user gets no card and no\nway to act, and both sides log success.\n\n`setPendingApprovalForThread` has exactly one production writer\n(`ChatRuntimeProvider.tsx:1198`, the socket handler), so the emit is the only\nway the card can ever appear. The emit itself cannot report failure —\n`io.to(room).emit()` on a room whose members have gone is a silent no-op and\nthe `Result` is discarded (`socketio.rs:1448`) — and there is no disconnect\nhandler in `socketio.rs`, so the core never learns a client died.\n\nDelivery can miss three independent ways: the addressed client's room is empty\nbecause the page reloaded; a reconnected socket is in the `thread:<id>` room\nonly for events emitted AFTER it joins, so one already emitted is gone; or the\nbridge drops the frame wholesale on broadcast lag (`socketio.rs:733`).\n\nNote what this is NOT. `approval_request` is not client_id-only addressed:\n`emit_web_channel_event` already fans out to the thread room as well, and the\nfrontend already re-subscribes on connect. That mitigation works — it just only\ncarries events emitted after the join. The defect is timing, not addressing,\nand the missing piece is replay.\n\nThe server already knew the answer and never used it: `pending_for_thread` had\nzero production callers. `parked_request_for_thread` extends it to the full row\n— routing map first, durable rows second, so a request decided between the two\nreads falls out as `None` rather than replaying an answered card — and\n`thread:subscribe`, the one signal that says "this socket is now watching this\nthread", replays it. Idempotent: the client keys on `request_id` and a decided\nrequest is no longer parked.\n\n`approval_request_event` is extracted so the live surface and the replay build\none payload rather than two shapes kept in step by hand.\n\nRevert-checked: with the lookup body neutered (signature kept, so the failure\nnames the assertion rather than a missing symbol) the new test fails on\n"a parked approval must be recoverable from its thread…" (46 passed, 1 failed).\nRestored: 47 passed. Wider: approval:: 125, web_chat:: 176, socketio 11.\n\nClaude-Session: https://claude.ai/code/session_016ipSkHi47nsBmnxX5dC4dA\n
M3gA-Mind committed 2 months ago
323be09
fix: validate routed turns and scope detached flows
Steven Enamakel committed 2 months ago
1d73ade
fix: validate routed turns and scope detached flows\n\n
Steven Enamakel committed 2 months ago
6cbe593
fix: close library route and lock retention gaps
Steven Enamakel committed 2 months ago
cf15e81
fix: close library route and lock retention gaps\n\n
Steven Enamakel committed 2 months ago
33ff5eb
fix: evict tombstoned index entries on delete errors
Steven Enamakel committed 2 months ago
5cccc12