Skip to content

Companion to mngr#2408: system_interface lifecycle state from the full observe stream#250

Draft
gnguralnick wants to merge 5 commits into
mainfrom
gabriel/observe-pid-watch
Draft

Companion to mngr#2408: system_interface lifecycle state from the full observe stream#250
gnguralnick wants to merge 5 commits into
mainfrom
gabriel/observe-pid-watch

Conversation

@gnguralnick

@gnguralnick gnguralnick commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Companion to mngr#2408 (the two land/merge separately).

Summary

Switch the system_interface agent manager from mngr observe --discovery-only (a state-less metadata stream that pinned every agent to a hardcoded RUNNING) to mngr observe --stream-events, whose AGENT_STATE / AGENTS_FULL_STATE / AGENT_REMOVED events carry each agent's real probed lifecycle state.

  • Fold observe events into a per-id AgentDetails view: full-state rebuilds the set, agent-state upserts one, agent-removed drops one. AgentStateItem.state is now the real state; messaging identity comes from AgentDetails.host.
  • A lifecycle-state change (e.g. RUNNING -> STOPPED when a process dies) re-gates the activity indicator through the unchanged is_agent_running gate, so a stopped agent drops its "Thinking..." indicator to idle.
  • Only the source of the state changed; the liveness-dot / activity-indicator UI is untouched. _initial_discover is kept (it also seeds the assist-auto-open baseline and already carries real state).

Vendor

  • Branch merged up to date with origin/main; the merge's only conflict was vendor/mngr, resolved by a coherent re-vendor of the whole tree from mngr bdec83414 (which contains the release36 SHA c55d2b225 that main vendored, plus the mngr#2408 change). Verified vendor-match: vendor/mngr equals mngr bdec83414 file-for-file (modulo the .minds/ files FCT's ignore strips).
  • The system_interface fold change is isolated in its own commit for review; the vendor refresh + the merge are separate commits.

Testing

  • Full apps/system_interface suite against the merged tree (main's new system_interface code + the re-vendored mngr): 557 passed (-m 'not tmux and not modal and not docker and not docker_sdk and not acceptance and not release' --no-cov). Two failures are environmental, not from this change: test_start_observe_spawns_long_lived_subprocess (mngr's is_allowed_in_pytest config guard aborts the real subprocess locally — flag-independent, passes in CI) and test_no_type_errors (local ty can't resolve modal/minds/latchkey; 0 errors in touched files).
  • New/rewritten fold tests cover: AGENT_STATE STOPPED flips state + re-gates activity to IDLE; AGENTS_FULL_STATE rebuild; AGENT_REMOVED removal side-effects; location matching from AgentDetails.host; assist auto-open. ty clean on agent_manager.py; ruff clean.

Gabriel Guralnick and others added 5 commits July 8, 2026 18:50
Switch the agent manager from `mngr observe --discovery-only` (a state-less
metadata stream that forced every agent to a hardcoded RUNNING) to
`mngr observe --stream-events`, whose AGENT_STATE / AGENTS_FULL_STATE /
AGENT_REMOVED events carry each agent's real probed lifecycle state.

- Fold observe events into a per-id AgentDetails view: full-state rebuilds
  the set, agent-state upserts one, agent-removed drops one. AgentStateItem.state
  is now the real state; messaging identity comes from AgentDetails.host.
- A lifecycle-state change (e.g. RUNNING -> STOPPED when a process dies) now
  re-gates the activity indicator through the unchanged is_agent_running gate,
  so a stopped agent drops its "Thinking..." indicator to idle.
- Only the source of the state changed; the dot / activity-indicator UI is
  untouched. _initial_discover is kept (it also seeds the assist-auto-open
  baseline and already carries real state).

Depends on the corresponding mngr change (the observe --stream-events mode,
AGENT_REMOVED event, and parse_observe_event_line) being vendored in; until
then this branch will not import.

Co-authored-by: Sculptor <sculptor@imbue.com>
Tracks 35b59cf47fb79fbdd30a3cc8658784da24e9c8b1 in mngr.
The vendored mngr now exposes `observe --stream-events`, so the live-CLI
argv contract check passes; remove the temporary skip.

Co-authored-by: Sculptor <sculptor@imbue.com>
The vendor/mngr refresh (Sync to 35b59cf47) changed the vendored mngr's
dependencies (e.g. psutil >=7.2 for the observe PID-watch, plus other deps
accumulated since the last vendor); regenerate the lock to match.

Co-authored-by: Sculptor <sculptor@imbue.com>
…atch

# Conflicts:
#	vendor/mngr/apps/minds/CHANGELOG.md
#	vendor/mngr/apps/minds/UNABRIDGED_CHANGELOG.md
#	vendor/mngr/dev/CHANGELOG.md
#	vendor/mngr/dev/UNABRIDGED_CHANGELOG.md
#	vendor/mngr/libs/mngr/CHANGELOG.md
#	vendor/mngr/libs/mngr/UNABRIDGED_CHANGELOG.md
#	vendor/mngr/libs/mngr_latchkey/CHANGELOG.md
#	vendor/mngr/libs/mngr_latchkey/UNABRIDGED_CHANGELOG.md
#	vendor/mngr/libs/mngr_modal/CHANGELOG.md
#	vendor/mngr/libs/mngr_modal/UNABRIDGED_CHANGELOG.md
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