Merge main into agent-framework-fallback: resolve conflicts#203
Merge main into agent-framework-fallback: resolve conflicts#203
Conversation
|
🤖 Hi @Zochory, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
🤖 I'm sorry @Zochory, but I was unable to process your request. Please see the logs for more details. |
There was a problem hiding this comment.
Pull Request Overview
Refactors callback handling into a ConsoleCallbacks class, introduces fallback stubs when agent_framework is absent, and adds enhanced checkpoint storage/listing plus agent runtime configuration support.
Key changes:
- Replaces module-level callbacks and thread-local UI registry with instance-based ConsoleCallbacks and ContextVar caches.
- Adds custom checkpoint storage (AgenticFleetFileCheckpointStorage) and refactors checkpoint listing/normalization.
- Introduces AgenticFleetChatAgent wrapper to carry runtime_config and updates agent factory functions accordingly.
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_magentic_fleet.py | Updates tests to use instance-based ConsoleCallbacks methods. |
| tests/test_cli_ui.py | Adapts UI tests to new ConsoleCallbacks interface. |
| src/agenticfleet/fleet/magentic_fleet.py | Integrates ConsoleCallbacks, refactors checkpoint listing, updates factory signature. |
| src/agenticfleet/fleet/fleet_builder.py | Adds fallback builder/client logic and routes observability through ConsoleCallbacks. |
| src/agenticfleet/fleet/callbacks.py | Replaces global callbacks with ConsoleCallbacks class; adds final render assembly. |
| src/agenticfleet/core/checkpoints.py | Adds custom file checkpoint storage with listing support. |
| src/agenticfleet/config/settings.py | Switches to custom checkpoint storage implementation. |
| src/agenticfleet/cli/ui.py | Adds FinalRenderData and simplifies final output rendering; removes global UI registry. |
| src/agenticfleet/cli/repl.py | Wires UI directly into workflow & consumes final render data. |
| src/agenticfleet/agents/*/agent.py | Switches agents to AgenticFleetChatAgent with runtime_config param. |
| src/agenticfleet/agents/base.py | Defines AgenticFleetChatAgent subclass. |
| README.md | Updates architecture image and dependency installation instructions. |
| Makefile | Adds explicit prerelease agent-framework installation commands. |
…ve output formatting
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
|
@codex fix this CI failure |
|
Summary
Testing
|
…e/AgenticFleet into agent-framework-fallback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
…dency - add mypy ignore_missing_imports to config - add type ignores for optional imports/assignments (WorkflowCheckpoint, MagenticBuilder, OpenAIResponsesClient) to avoid spurious type/lint errors
…ckpoint fallback, fix OpenAI model param detection - Use final_render from workflow console callbacks when present to display final output in the REPL. - Adjust readiness/divider printing order for clearer console output. - Guard console_callbacks.bind_ui(None) in run_repl_main finally block to avoid errors if workflow_instance isn't created. - Remove unused WorkflowCheckpoint fallback class from checkpoints import fallback. - Correct get_responses_model_parameter to return "model_id" when that parameter exists on the client.
…LI/UI callbacks, HITL, workflow & docs - Add runtime guards for optional agent_framework imports and surface clear AgentConfigurationError - Replace AgenticFleetChatAgent with FleetAgent and provide fallback that errors when dependency missing - Update all agent factories to check OpenAIResponsesClient and raise when unavailable - Introduce settings.require_openai_api_key(), lazy OPENAI_API_KEY handling and checkpoint warning when agent_framework absent - Use require_openai_api_key in mem0 provider and FleetBuilder; pull workflow defaults into FleetBuilder - Enhance MagenticFleet: dependency-safe imports, streaming/run_stream support, plan-review approval flow, console UI binding API (set_console_ui), hosted code interpreter wiring - Refactor ConsoleCallbacks and ConsoleUI: stronger typing/protocol, improved formatting, log_final handling and _print_section helper - Extend approved_tools to support required/trusted operations and short-circuit approval checks; wire into code_execution approval helpers - Update CLI/repl to use set_console_ui and annotate _workflow_instance; make cli package lazy-import safe - Broad docs & tests updates: switch examples and commands to `uv run fleet`, update paths to src/, refresh release/runbook entries and adjust tests to new APIs and behaviors
|
@codex fix this CI failure |
|
Summary
Testing
|
…lity - Replace tuple syntax (int, float) with union syntax int | float - Fixes ruff UP038 rule violation in checkpoints.py
|
@codex fix this CI failure |
|
Summary
Testing
|
|
@codex fix this CI failure |
| else: | ||
| break | ||
|
|
||
| events: list[MagenticCallbackEvent] = [event async for event in stream] |
There was a problem hiding this comment.
All streamed events are materialized into a list before processing, which can grow large for long-running or verbose workflows. Process the async generator incrementally (for event in stream: ...) to reduce memory usage and improve responsiveness for plan review handling.
| operation_type = "code_execution" | ||
| handler = get_approval_handler() | ||
| if handler is None: | ||
| return CodeApprovalResult(outcome=CodeApprovalOutcome.NO_HANDLER) | ||
|
|
||
| if not operation_requires_approval(operation_type): | ||
| return CodeApprovalResult(outcome=CodeApprovalOutcome.APPROVED) |
There was a problem hiding this comment.
Approval gating logic (deriving operation_type, handler retrieval, early returns) is duplicated here and in approved_tools (lines 95–103 / 139–143). Extract a shared helper (e.g., should_request_approval(operation_type)) to centralize the decision and reduce divergence risk.
| operation_type = "code_execution" | ||
| handler = get_approval_handler() | ||
|
|
||
| if handler is None: | ||
| if handler is None or not operation_requires_approval(operation_type): | ||
| return _execute_without_approval(code, language) |
There was a problem hiding this comment.
This conditional duplicates the gating logic implemented in maybe_request_approval_for_code_execution; consolidating via a shared helper would reduce drift if approval policy rules change.
| async def _handle_plan_review_request( | ||
| self, | ||
| event: RequestInfoEvent, | ||
| ) -> MagenticPlanReviewReply: | ||
| request = cast(MagenticPlanReviewRequest, event.data) | ||
| await self.console_callbacks.notice_callback("Plan review requested.") | ||
| await asyncio.sleep(0) | ||
|
|
||
| if self.approval_handler is not None: | ||
| approval_request = create_approval_request( | ||
| operation_type="plan_review", | ||
| agent_name="magentic_orchestrator", | ||
| operation="Approve or revise plan", | ||
| details={ | ||
| "task_text": request.task_text, | ||
| "facts_text": request.facts_text, | ||
| "plan_text": request.plan_text, | ||
| "round_index": request.round_index, | ||
| }, | ||
| ) | ||
| response = await self.approval_handler.request_approval(approval_request) | ||
|
|
||
| if response.decision == ApprovalDecision.APPROVED: | ||
| edited = response.modified_code if response.modified_code else None | ||
| return MagenticPlanReviewReply( | ||
| decision=MagenticPlanReviewDecision.APPROVE, | ||
| edited_plan_text=edited, | ||
| comments=response.reason, | ||
| ) | ||
|
|
||
| if response.decision == ApprovalDecision.MODIFIED: | ||
| return MagenticPlanReviewReply( | ||
| decision=MagenticPlanReviewDecision.APPROVE, | ||
| edited_plan_text=response.modified_code, | ||
| comments=response.reason, | ||
| ) | ||
|
|
||
| return MagenticPlanReviewReply( | ||
| decision=MagenticPlanReviewDecision.REVISE, | ||
| comments=response.reason or "Reviewer requested a revised plan.", | ||
| ) | ||
|
|
||
| return MagenticPlanReviewReply(decision=MagenticPlanReviewDecision.APPROVE) |
There was a problem hiding this comment.
New plan review approval branches (APPROVED, MODIFIED, REVISE, default approve) lack test coverage—only basic code execution approval paths are tested. Add tests simulating each ApprovalDecision to ensure comments, edited_plan_text handling, and default auto‑approve behavior remain correct and aligned with the documented Magentic workflow cycle.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
|
Summary
Testing
|
…" param - Delete outdated GEMINI.md documentation. - Reflow and tidy docstring lines in approved_tools.set_approval_handler (formatting only). - Change get_responses_model_parameter to return "model" (instead of "model_id") as the default responses parameter to align with common client signatures and VAR_KEYWORD handling.
Add an autouse pytest fixture that monkeypatches prompt_toolkit.output.defaults.create_output to return DummyOutput when running in CI (CI=true). This forces a platform-independent output backend during tests to prevent Windows console-related errors in CI environments. If prompt_toolkit is not installed, the fixture is a no-op.
Description
Type of Change
Related Issues
Fixes #
Changes Made
Testing
uv run pytest)uv run python tests/test_config.py)uv run ruff check .)uv run black .)uv run mypy .)Test Commands Run
Documentation
Screenshots (if applicable)
Checklist
Additional Notes