Skip to content

Fix tool max calls - #60

Merged
wangxingjun778 merged 47 commits into
mainfrom
feat/mhs
Nov 20, 2026
Merged

wangxingjun778 merged 47 commits into
mainfrom
feat/mhs

Conversation

@wangxingjun778

Copy link
Copy Markdown
Member

No description provided.

wangxingjun778 and others added 30 commits October 13, 2026 16:50
Add grouped freshness, typed health signals, optional ROS previews and native-depth encoders. Drain daemon clients during graceful shutdown and cover ownership, release, and restart paths with regression tests.
Signed-off-by: 班扬 <xingjun.wxj@alibaba-inc.com>
- Stop tracking .qoder/ (Qoder agent scratch space: build artifacts, repo snapshots and vendored wheels, ~70MB) and ignore it going forward. Local files are retained.
- Map the tooling-mislabeled "Cheney Zhang <chen.zhang@zilliz.com>" author, written by a commit skill that hardcoded --author, to the committer's real identity via .mailmap. Published history on main and the release branches is deliberately not rewritten.

Signed-off-by: wangxingjun778 <wangxingjun778@163.com>
The 18 commits whose author field was overridden by the commit skill are now rewritten in history, so the display-layer alias is dead weight.

Signed-off-by: wangxingjun778 <wangxingjun778@163.com>
- add report-only observation policy (soft bounds, confirmation, adaptive
  noise margin) with hot reload; hard envelope and write authority unchanged
- attach observation episodes to hardware events; persist notification
  checkpoints so findings survive watch/daemon restarts
- evaluate raw sample safety evidence before presentation pacing
- qualify physical rate on source acquisition epochs and declared sequence
  scopes instead of poll counters or host arrival timing
- add `leap hw stop`: node record discovery, systemd-owned or SIGTERM stop
  of the local LHP node with ordered cleanup and no automatic SIGKILL
- report unsettled effect causes in device-busy refusals; mark Piper gripper
  force as an unqualified SDK report and split target-not-sent from
  target-refused motion failures
…ck self-termination

Fleet supervision
- add hardware/fleet_supervision.py: pending-node registry with exponential
  backoff (hardware.fleet_retry_initial_s / _max_s), so a node unreachable at
  startup rejoins without a leapd restart
- FleetManager keeps failed nodes as "unregistered", retries them from the
  heartbeat sweep, probes their endpoint for node_health, and exposes
  reconnect(); late registration re-admits trust configs, health records and a
  hw.fleet.node_online event
- new hw_fleet_reconnect tool, hardware.fleet_reconnect RPC and
  `leap hw fleet reconnect [node]` CLI; skill resolution skips unregistered nodes

Daemon lifecycle
- leapd announces every deliberate shutdown to open streams (daemon_shutdown
  event, reason + requested_by) before closing them; clients raise
  DaemonShutdownError and say who stopped leapd and that the turn was interrupted
- daemon.shutdown carries reason/requested_by; signal and idle-timeout paths
  announce too; streams are tracked per writer so concurrent clients each get it

Self-termination guard
- leapd exports LEAPFLOW_HOST_DAEMON_PID; `leap daemon stop|restart` refuses when
  launched from inside the daemon it targets (--force included), and shell_run,
  terminal_open/terminal_send block the equivalent commands as
  self_termination_blocked
- config_set and the config tool description tell the model to have the user
  restart leapd after the turn; `leap hw list` refuses when leapd owns the store

Plugin health and hardware observation
- plugin health policy is now Settings-driven and hot-reloaded
  (plugin_health.error_rate_threshold/error_window_s/min_calls); windowed stats,
  failed_codes, GRADING_VERSION=2 and a disable action only for non-input failures
- hc.v1 devices may declare actuation_state_channel; a fresh disabled sample
  lowers threshold_exceeded severity with actionable detail, never safety
- stale quality no longer counts as degraded; the reception clock substitutes for
  an invalid reading clock; registry.latest_sample reads an existing ring without
  claiming the device; restored incidents can close on fresh healthy evidence

Config propagation
- runtime config reload notifies the daemon owner synchronously, propagates
  workspace-scoped settings to every session, and converges the reentry
  coordinator; stopping reentry clears its observers

Tests: 938 + 51 focused tests pass; cassettes regenerated for the new tool index.
…se a removed installation

- add DaemonRpcError: a reachable leapd that rejected or failed an RPC is no
  longer reported as transport unavailability. It keeps the wire code/data and
  carries a non-recoverable FailureEnvelope with side_effect_state=unknown, so a
  backend response is never read as proof that nothing happened. DaemonClient
  raises it from request/stream/preview paths, error frames included, and it is
  deliberately not a DaemonUnavailableError subclass.
- TUI: a request error is reported as such and not replayed or reconnected;
  connection-loss messages now distinguish "after receiving turn output" from
  "again before output" instead of one blanket "after the turn started".
- runtime_installation_error(): detect that the running package files were
  removed beneath leapd (a wheel-to-editable reinstall) using the already-loaded
  origin, without lazy imports. status() exposes it and the TUI warns; engine_chat
  refuses before deferred init, admission, session construction, or engine I/O,
  naming the resolve step (finish at home terminal, never from inside a turn).

Tests: 302 passed across daemon/CLI modules.
…dentity

Presentation
- add monitor/delivery.py: BoundedFindingDelivery persists evidence before it
  gates it, then coalesces one aggregate notice per incident under a single
  global budget (minimum_severity=critical, global_interval_s=5,
  repeat_interval_s=60, max_pending/max_items/max_bytes/max_state bounds), with
  a durable cooldown/overflow spool so a restart cannot re-page history.
- add Severity.CRITICAL (rank 3). Unsolicited presentation defaults to the
  critical floor; alert/notable/info stay persisted and inspectable on the board.
  Recovery is silent, and an actionable (execution-interrupting) notice survives
  its own recovery.
- Findings declare FindingDelivery (key, phase, active, current, actionable,
  withdrawn_keys); FindingStore persists it and withdraws live notices instead of
  pushing a recovery card. A CurrentIncidentSource producer revalidates delayed
  evidence immediately before enqueue and before emit.
- emit monitor.updated (throttled) so a view can refresh without a notice.

Notification fan-out
- NotificationBus is now an event-loop-owned bounded fan-out with priority
  insertion, coalescing of replaceable events (monitor.updated, signal.stream,
  view.resync, teach.progress), eviction of lower-priority queued work, a
  guaranteed shutdown sentinel on a full queue, subscription ownership by queue,
  and enqueue/overflow stats in status().

Hardware observation
- rate_confirm_s / rate_recover_s debounce reporting only; rate evidence now
  carries measured/declared rate, delta, acquisition interval and timebase.
- add observation_unknown: when continuous report evidence is lost, the episode
  is revalidated rather than replaced by a new UUID, and an unknown transition
  still wakes watches.
- the producer emits transitions with delivery identity, promotes confirmed
  threshold/stale/unreachable conditions to critical, and keeps disabled-resting
  pose findings notable.

Monitor lifecycle
- MonitorManager owns delivery start/stop, cancels background tasks, persists
  event-due times off the loop, re-registers event triggers on start, drops
  watch-owned notices on pause/stop/mute, and no longer overwrites a deliberate
  user pause on reseed; add the hardware-live event watch.

Surfaces
- TUI renders a single compact critical notice and keeps details for /board list;
  the dashboard adds critical to severity charts/legends, coalesces toasts to one
  critical toast, and debounces refreshes on monitor.updated.
- new monitor.delivery JSON setting (validated on load and on config_set);
  status exposes delivery counters and notification fan-out stats, and
  self_describe surfaces the monitor domain.

Tests: three existing tests are updated to the new presentation contract (flush
the delivery, read the aggregate payload, critical floor). 723 + 80 focused
tests pass; ruff clean.
Isolate guard state per session. Extend productive turns from 50 tool calls by 25 up to 150 while preserving resource and repetition limits. Count text-mode calls and provide cap-aware continuation guidance. Cover configuration, concurrent workspaces, and unified streaming execution.
@wangxingjun778
wangxingjun778 merged commit 1700a8d into main Nov 20, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant