Skip to content

mngr/move-list-stream#1028

Open
joshalbrecht wants to merge 9 commits intojosh/polish_mindsfrom
mngr/move-list-stream
Open

mngr/move-list-stream#1028
joshalbrecht wants to merge 9 commits intojosh/polish_mindsfrom
mngr/move-list-stream

Conversation

@joshalbrecht
Copy link
Copy Markdown
Contributor

Automated PR created by Claude Code session.

joshalbrecht and others added 9 commits March 28, 2026 16:23
…-discovery-only'

The streaming functionality doesn't belong in 'list' because none of the
list filtering/sorting options make sense with it. It fits naturally as
a mode of 'observe' since observe already runs it internally.

- Extract discovery stream logic from cli/list.py to api/discovery_events.py
  as run_discovery_stream() with an optional on_line callback
- Add --discovery-only flag to 'mngr observe' CLI
- Remove --stream flag from 'mngr list' CLI
- Update AgentObserver to spawn 'mngr observe --discovery-only' subprocess
- Update MngrStreamManager in minds app to use new command
- Move stream tests to discovery_events_test.py, update list tests
- Regenerate CLI docs, update tutorial examples
- Fix pre-existing ruff issues in observe.py (unused pdb import, B007)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem: The `poll_until` import from `imbue.mngr.utils.polling` was placed
before the `OnlineHostInterface` import from `imbue.mngr.interfaces.host`,
breaking alphabetical ordering within the first-party import block.
Fix: Swap the two imports to restore correct alphabetical order.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem: The `poll_until` import from `imbue.mngr.utils.polling` was placed
before the `imbue.mngr.primitives` imports, violating the isort rules
enforced by the pre-commit hook (ruff --select I). Additionally, the
blank line separator between third-party and first-party imports was missing.

Fix: Reordered imports to match ruff isort conventions, placing
`imbue.mngr.primitives` before `imbue.mngr.utils.polling` and adding the
required blank line after third-party imports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem: Private attribute _list_stream_process and methods _start_list_stream,
_on_list_stream_output still used the old "list_stream" naming even though the
command was changed from "mngr list --stream" to "mngr observe --discovery-only".
Fix: Renamed to _discovery_stream_process, _start_discovery_stream, and
_on_discovery_stream_output to match the actual operation being performed.
Updated corresponding tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…treamManager

Problem: Method _on_list_stream_output in MngrStreamManager still used the old
"list_stream" naming even though the command was changed from "mngr list --stream"
to "mngr observe --discovery-only".
Fix: Renamed to _on_discovery_stream_output to match the actual operation being
performed. Updated corresponding tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem: error_behavior was computed before the if/else branch in observe.py,
making it appear to apply to both the --discovery-only and full observe paths.
In reality, AgentObserver hardcodes ErrorBehavior.CONTINUE, so the --on-error
option had no effect in the full observe path. This is misleading dead code.

Fix: Move error_behavior computation inside the if opts.discovery_only block
to make it clear that --on-error only applies to discovery-only mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem: The file was named list_stream_test.py but no longer contains any
stream-related tests after those were moved to discovery_events_test.py.
The remaining tests are all watch mode tests.
Fix: Rename to list_watch_test.py to accurately reflect the file contents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem: test_discovery_stream_tail_detects_new_content manually replaced
sys.stdout with a StringIO to capture output, which is fragile when running
concurrent threads and unnecessary since _discovery_stream_tail_events_file
accepts an on_line callback parameter for exactly this purpose.

Fix: Use the on_line callback (captured_lines.append) instead of manipulating
sys.stdout. Remove the now-unused sys and StringIO imports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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