Repository navigation
Long hardware tasks run to completion - #62
Merged
Merged
Conversation
Bind reusable consent to declarations and destinations, unify owned-evidence approval, expose scoped permissions and revocation, and prevent stale consent writes after revocation.
…e contracts - llm/services: typed task admission (contracts), immutable per-caller telemetry records, and provider/runtime/codec wiring for them - hardware: passive bounded clip skill behind an owner port (new builtin entry point), conservative grasp installation preparation, hardware-owned query contracts, and frames/readiness/snapshot evidence updates - engine: streaming usage telemetry, result budget, session factory and learning bridge updates - tools: model service/tools telemetry and fixture alignment - tests: media replay harness, refreshed journey cassettes and expanded coverage for contracts, telemetry, clips and dispatch - docs: plugin lifecycle and third-party plugin development refresh
…s compact raw readings, off-loop focus polling
… stationary-board bridge Relocation recipe - Publish the hardware relocation recipe as a composite tool whose children (hw_skill_run, hw_skill_list, decision) run through the dispatch's caller-bound child invoker, bound only while the composite tool runs. - Read the workcell's published limits (speed, max_steps, transits) from hw_skill_list and fall back to conservative defaults; a published limit wins. - Pack adjacent logical phases into the fewest runs within max_steps and verify each phase from its own steps; a halt keeps earlier verified runs. Tool dispatch - Expose the frame catalog and a child invoker on the execution context; a composite tool's declared child is callable for its one dispatch even when its schema was not disclosed, but never outside the frame catalog. - Settle an in-flight tool record so a later identical call reads a verdict instead of waiting on a future that never resolves. - Register composite hardware recipes only once a fleet is configured. Stationary-board bridge - Split the bridge budget into systematic terms (robot_fk, wrist_mount, board_scale_flatness, intrinsics), summed in full, and random terms (pnp_depth, timing, repeatability), used only as floors for the scatter the residuals already measure. A numerical pass now carries the bound its held-out pairs actually had, not the declared prior alone. - Judge planar-pose ambiguity by how far the solver's alternative lies from the chosen pose (5 deg), not by the reprojection gap alone; retain the alternative in the detection. - Record per-camera detection summaries so an exclusion is understandable without raw frames. Docs - Describe the motion-free route for a fixed camera whose board must stay stationary: calib.bridge, calib.promote, calib.attest. Tests: relocation recipe, tool invoker (with recorded cassettes), and LeapCalib bridge unit and integration tests.
…d-turn notices, rebuilt journey cassettes Specialist media path: - llm/services/codec.py, tools/model_tools.py: one shared media_capacity_error; a zero-capacity modality now refuses with the substitute to use instead of a bare count, so a text/image-only specialist stays usable and the primary LLM is told the truth before anything leaves the host - model_query / export_evidence / perceive.clip card: check model_describe media capacity before attaching clips; measurements go in decision.state - d3 declared as 4 images / 1 video in the host profile (deployed, not in repo) Also carries the concurrent working-tree changes: session_id-bound observation consent in daemon/service.py, security/orchestrator.py and daemon/client.py; cancelled-turn notices persisted to history; per-session tool continuity in tool_dispatch_engine; hardware recipe/skill tool timeout metadata; write governor and relocation recipe updates; tests and journey cassette stores rebuilt.
…hard-cap extension, turn detach and re-attach Why: a grasp ablation on the Piper workcell stopped after ~30 tool calls although every step succeeded. Three harness limits ended the turn, not the task. Engine budget (P1-4, P1-5) - Tool results may declare `task_progress` (result_progress_key); governance and the stall marker count declared progress as evidence, consent outcomes are not failures, and only a true stall opens long-exploration. - Past `agent_iter_hard_cap` the cap is a stricter gate, not a stop: a turn still executing new actions every round extends in `agent_iter_extension_step` steps, never beyond twice the cap (IterationConfig.backstop). `TurnCapGuard` applies the same strict gate to the tool-call cap. - `hw_context_snapshot` declares its progress key from device state only; live sensor readings no longer read as progress forever. - `code_search` runs off the event loop with a deadline; skill `max_steps` 16 -> 64. leapd (P1-6, P1-7) - The loop-lag watchdog names the RPC and the session behind a stall. - `_TurnPump` owns the `engine.chat` generator: a TUI read timeout or dropped socket detaches the turn instead of cancelling it, for `daemon.turn_detach_grace_s` (default 120 s, 0 = old behaviour). Output is logged so `engine.attach` resumes a live turn or replays an ended one from the ledger; an unknown turn is refused, never re-run. A duplicate request id keeps the live turn's pump; daemon-side cancellation records `status: cancelled`. - DaemonUnreachable marks a request that provably never reached leapd. TUI - A lost chat stream reconnects and re-attaches automatically from the last rendered event; `/attach` resumes an interrupted turn manually. A prompt is re-sent only when it could not be handed to leapd at all. Tests: tests/test_turn_cancel_release.py (detach, grace expiry, grace 0, duplicate id, attach refusal), tests/test_daemon_rpc.py, tests/test_adaptive_depth.py.
…y resets it, capped_count surfaced in TUI and LeapBoard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Long hardware tasks run to completion
task_progress: {key}; stall detection and context governance count an unseen key as new work, so an execution task (skill runs, writes, app actions) no longer reads as stalled. Consent outcomes (refusal / approval required) are no longer counted as tool failures.agent_iter_hard_capa turn still executing new actions each round extends inagent_iter_extension_stepincrements, bounded byIterationConfig.backstop(never beyond 2× the cap).TurnCapGuardapplies the same gate to the tool-call cap.code_searchoff the event loop under one deadline, honoring.gitignoreand skipping oversized files — a slow search is now just a slow tool call instead of a frozen daemon.Resilient TUI ↔ leapd turn sessions
daemon.turn_detach_grace_s(default 120 s,0= old behavior)./attach [request_id]resumes an interrupted turn; the TUI auto-reconnects and re-attaches from the last rendered event. A live turn streams on, an ended one replays from the ledger, an unknown turn is refused (never re-run), and a duplicate request id keeps the live pump. Daemon-side cancellation recordsstatus: cancelled.DaemonUnreachablevsDaemonReadTimeout) so a prompt is re-sent only when it provably never reached leapd.Hardware recipes as composite tools
hw_skill_run,hw_skill_list,model_query_batch) run through a caller-bound child invoker, bound only while the composite runs — children keep validation, ledger, approval, permits and freshness checks.max_steps) are read fromhw_skill_list; a published limit wins over defaults, and adjacent logical phases are packed into the fewest runs while each phase is verified from its own steps.x_leapflow["timeout_s"]; per-child timeouts still apply.Consent bound to the session that granted it
hardware.frame,hardware.read, preview streams share onesession_id).approval.prompted, so recipes and reports count user attention honestly.Specialist services and media capacity
media_capacity_error: a zero-capacity modality refuses with the substitute to use instead of a bare count, before any byte leaves the host.model_query,export_evidenceandperceive.clipcheck capacity before attaching clips.Calibration
calib.bridge→calib.promote→calib.attest, plus a rewritten LeapCalib quickstart.Monitor notices
max_noticesbudget (default 3): a condition that never recovers stops paging and stays on the board; recovery resets the budget.capped_countis surfaced in the TUI and LeapBoard (all locales).Context governance and session continuity
Configuration and tests
daemon.turn_detach_grace_s,monitor.delivery.max_notices(env:LEAPFLOW_DAEMON_TURN_DETACH_GRACE_S,LEAPFLOW_DAEMON_STREAM_PATIENCE_S).tests/test_tool_invoker.py; expanded coverage for turn cancel/release, daemon RPC attach, agent execution budget, monitor delivery, relocation recipe and tool result tiers. Journey cassette stores were rebuilt; the network/ASR transcription tool was removed.