Skip to content

fix(agent): unify CLI probe pipeline with classified failures and adaptive slow-probe recheck#678

Merged
kaizhou-lab merged 4 commits into
mainfrom
fix/agent-probe-pipeline
Jul 24, 2026
Merged

fix(agent): unify CLI probe pipeline with classified failures and adaptive slow-probe recheck#678
kaizhou-lab merged 4 commits into
mainfrom
fix/agent-probe-pipeline

Conversation

@kaizhou-lab

Copy link
Copy Markdown
Contributor

Closes #675

Summary

  • Classify version-probe failures (cli_probe.rs): command_not_found / version_probe_failed (exit != 0 — corrupted install, fails fast) / version_probe_timeout (slow load — NOT proof of corruption), with the measured --version duration reported on success and carried in every failure message.
  • Timeout no longer condemns an agent to Missing: the row stays installed, surfaces as Unchecked (which the generated-assistant reconcile already materializes, so the agent stays visible in the assistant list), and is queued for a background recheck.
  • Background slow-probe recheck (registry.rs): after hydrate(), pending agents are re-probed sequentially with a 30s budget off the readiness path; the outcome is persisted as a startup-kind snapshot with the measured latency.
  • Adaptive inline skip: an agent whose persisted startup snapshot shows a slow probe (timeout, or latency > 2s) skips the inline 5s probe entirely on the next hydrate — each machine pays the 5s lesson at most once per agent, and backend readiness is never dragged by known-slow CLIs. No static slow-list: "slow" is a property of package × machine, learned from measured history.
  • A failing --version (exit != 0) now means corrupted-install: installed + Offline with version_probe_failed and the stderr head, instead of Missing ("not installed") which sent users down the wrong path.
  • Manual test connection is the self-rescue path: no longer short-circuited by a stale available=false verdict, always reaches its real probe, and a success restores the agent to online. reload_one no longer re-runs --version on every cache refresh (it double-probed every manual check and stomped fresher manual snapshots with a startup-kind verdict).
  • Builtin claude/codex manual check now runs PATH + --version (was PATH-only, so a corrupted install showed online). They do not speak ACP, so no session/new-style handshake is added — --version integrity is their deep check.
  • Commandless-builtin fallback unified: the PATH-only cli_detect side door is removed; the fallback branch uses the same classified probe engine.
  • Unchanged by design: ACP-agent deep check (real initialize handshake with classified command_not_found / acp_init_failed / auth_required), Aion CLI provider-readiness check (no_provider), and the skip_version_probe lock flag (still only sigit; pi keeps its integrity probe).
  • UI guidance strings added for the new error codes. No frontend changes required.

Background

Sentry feedback ELECTRON-3PN ("公司内网中pi链接不上"): pi-acp's prerequisite pi CLI (~19,300 files installed) takes 5.6–6.8s to cold-load --version on the affected Windows machine, so the fixed 5s probe always timed out and AionUi treated a correctly-installed agent as not installed, with no diagnosable error anywhere. The same user's db shows Claude Code manual-check latency at 3753ms — one AV scan away from the same cliff. See #675 for the full analysis and code map.

Verification

  • cargo nextest run --workspace: 7431 passed, 0 failed (18 skipped)
  • cargo clippy --workspace --all-targets: clean
  • just migration-check: passed (no migrations touched)
  • New tests: probe classification (4), adaptive pipeline incl. deterministic skip-proof via execution marker (4), manual-check semantics incl. restoration (5)

zk added 4 commits July 24, 2026 11:26
…ration

Replace the stringly-typed probe error with ProbeFailure variants that
separate command_not_found / version_probe_failed (exit != 0, corrupted
install) / version_probe_timeout (slow load, not proof of corruption),
and report the measured --version duration on success. Groundwork for
adaptive slow-probe handling (#675).
- inline --version timeout no longer condemns an agent to Missing: the row
  stays installed (Unchecked), is queued, and a background recheck with a
  30s budget settles it, persisting a startup snapshot with the measured
  duration so the next hydrate skips the inline probe for known-slow CLIs
- a failing --version (exit != 0) now means corrupted-install: installed +
  Offline with version_probe_failed, instead of Missing
- manual health check is never short-circuited by a stale availability
  verdict and always reaches its real probe; reload_one no longer re-runs
  --version on every cache refresh (it stomped fresher manual snapshots)
- builtin claude/codex manual check runs PATH + --version (was PATH-only);
  commandless builtin fallback gets the same classified treatment and the
  PATH-only cli_detect side door is removed
@kaizhou-lab
kaizhou-lab enabled auto-merge (squash) July 24, 2026 06:03
@kaizhou-lab
kaizhou-lab merged commit 67945d2 into main Jul 24, 2026
6 checks passed
@kaizhou-lab
kaizhou-lab deleted the fix/agent-probe-pipeline branch July 24, 2026 06:12
kaizhou-lab pushed a commit that referenced this pull request Jul 24, 2026
…r delta table

The mixed-scope agent_metadata catalog let one agent_id have a global template
row plus per-user copy-on-write copies. Machine-level startup probes (unified in
main #678) took the no-acting-user write path, which minted system_default_user
copies on every AionPro boot — the catalog's single source of truth forked, and
identity fields could drift out of sync across copies.

- agent_metadata is now UNIQUE(agent_id): exactly one row per agent (builtin =
  user_id NULL; custom = creator's id as an ownership attribute). No copies.
- New agent_user_state(user_id, agent_id) holds every per-user delta: enabled
  toggle, command/env overrides, session-scoped availability, handshake caches.
  Reads LEFT JOIN and overlay user-first; the availability snapshot is taken
  whole from the winning side so its fields never mix.
- Startup probes UPDATE the catalog row in place (never insert); session
  outcomes / manual checks upsert the user's delta row.
- AionPro startup no longer runs the default-user generated-assistant reconcile
  or ingests the legacy shared skill directory (unattributable files); each real
  user materializes generated assistants lazily. Channel default-assistant
  resolution triggers that lazy materialization via a composition-layer port so
  the bare fallback still resolves.
- Gate e2e: after a full AionPro boot, no ownership column outside users holds a
  system_default_user row. Handshake/binding tests updated to the single-row model.
piorpua pushed a commit that referenced this pull request Jul 24, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.52](v0.1.51...v0.1.52)
(2026-07-24)


### Features

* **project:** wire project-bind side branch into owner creation
([#676](#676))
([300c833](300c833))


### Bug Fixes

* **agent:** unify CLI probe pipeline with classified failures and
adaptive slow-probe recheck
([#678](#678))
([67945d2](67945d2))
* **channel:** quiet WeChat poll log noise with state-transition logging
and exponential backoff
([#683](#683))
([ea4da55](ea4da55))
* **process:** allow whitespace in workspace cwd segments
([#410](#410) parity)
([#674](#674))
([c344b02](c344b02))
* **session:** restore codex slash commands + recover dead resume
anchors on the direct-CLI path
([#679](#679))
([7b60611](7b60611))
* **team:** converge system/lifecycle wakes into a team run
([#680](#680))
([38facd7](38facd7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ChristianLuciani added a commit to ChristianLuciani/AionCore that referenced this pull request Jul 25, 2026
Bring feat/ollama-launch-acp up to date with upstream main.

Conflict resolutions:
- Keep both mcp_resolve (session-port) and ollama modules
- Session-port still routes claude/codex by default; bypass to ACP when
  use_ollama && ollama_compatible so env injection can apply
- Drop cli_detect.rs (removed upstream in iOfficeAI#678); ollama field only needed
  on remaining AgentMetadata test fixtures
- Restore OLLAMA_COMPATIBLE_BACKENDS constants + tests on main layout
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.

fix(agent): unify CLI probe pipeline — classify failures, adaptive slow-probe skip, background recheck (ELECTRON-3PN)

1 participant