Skip to content

Merge main into agent-framework-fallback: resolve conflicts#203

Merged
Zochory merged 24 commits intomainfrom
agent-framework-fallback
Oct 16, 2025
Merged

Merge main into agent-framework-fallback: resolve conflicts#203
Zochory merged 24 commits intomainfrom
agent-framework-fallback

Conversation

@Zochory
Copy link
Member

@Zochory Zochory commented Oct 15, 2025

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test updates
  • Configuration change

Related Issues

Fixes #

Changes Made

  • (describe your changes here)

Testing

  • All existing tests pass (uv run pytest)
  • Added new tests for new functionality
  • Configuration validation passes (uv run python tests/test_config.py)
  • Linting passes (uv run ruff check .)
  • Formatting is correct (uv run black .)
  • Type checking passes (uv run mypy .)

Test Commands Run

# Commands run to validate changes
uv run pytest
uv run python tests/test_config.py
uv run ruff check .
uv run black .

Documentation

  • Updated relevant documentation
  • Added docstrings to new functions/classes
  • Updated README if needed
  • Updated CHANGELOG if needed

Screenshots (if applicable)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

@github-project-automation github-project-automation bot moved this to Backlog in AgenticFleet Oct 15, 2025
@github-actions github-actions bot added area: config Configuration system type: documentation Improvements or additions to documentation area: agents Agent-related code type: test Test-related changes area: cli Command-line interface python Python-related changes labels Oct 15, 2025
@github-actions
Copy link
Contributor

🤖 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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link
Contributor

🤖 I'm sorry @Zochory, but I was unable to process your request. Please see the logs for more details.

@Zochory Zochory requested a review from Copilot October 15, 2025 22:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Zochory Zochory added this to the v0.5.1 milestone Oct 15, 2025
Zochory and others added 2 commits October 16, 2025 00:15
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>
@Zochory Zochory requested a review from Copilot October 15, 2025 22:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Zachary BENSALEM <zachary@qredence.ai>
@Zochory Zochory marked this pull request as ready for review October 16, 2025 00:04
@Zochory
Copy link
Member Author

Zochory commented Oct 16, 2025

@codex fix this CI failure

@Zochory Zochory requested a review from Copilot October 16, 2025 00:18
@Zochory Zochory self-assigned this Oct 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.

@chatgpt-codex-connector
Copy link

Summary

Testing

  • uv run pytest tests/test_magentic_fleet.py

View task →

Zochory and others added 5 commits October 16, 2025 03:29
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.
@github-actions github-actions bot added the dependencies Dependency updates label Oct 16, 2025
…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
@github-actions github-actions bot added the area: memory Memory/context provider label Oct 16, 2025
@Zochory Zochory linked an issue Oct 16, 2025 that may be closed by this pull request
32 tasks
@Zochory
Copy link
Member Author

Zochory commented Oct 16, 2025

@codex fix this CI failure

@chatgpt-codex-connector
Copy link

Summary

Testing

  • uv run pytest tests/test_magentic_fleet.py

View task →

…lity

- Replace tuple syntax (int, float) with union syntax int | float
- Fixes ruff UP038 rule violation in checkpoints.py
@Zochory
Copy link
Member Author

Zochory commented Oct 16, 2025

@codex fix this CI failure

@chatgpt-codex-connector
Copy link

Summary

  • Added defensive checks in MagenticFleet._apply_coder_tooling to validate the configured model name, fall back to settings.openai_model only when it is a non-empty string, and skip coder tooling setup when no valid model is available while logging a debug message for observability. src/agenticfleet/fleet/magentic_fleet.pyL168-L199

Testing

  • uv run pytest

View task →

@Zochory Zochory requested a review from Copilot October 16, 2025 07:33
@Zochory
Copy link
Member Author

Zochory commented Oct 16, 2025

@codex fix this CI failure

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 35 out of 38 changed files in this pull request and generated 6 comments.

else:
break

events: list[MagenticCallbackEvent] = [event async for event in stream]
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +50
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)
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +95 to 99
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)
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +357 to +399
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)
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fix and resolve conversation

Zochory and others added 4 commits October 16, 2025 09:36
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>
@chatgpt-codex-connector
Copy link

Summary

  • Updated the OpenAI responses client helper to default to the legacy model keyword when no explicit parameter is exposed, preserving compatibility with older client signatures. src/agenticfleet/core/openai.pyL8-L31
  • Replaced ellipsis bodies in ConsoleUIProtocol with pass statements so the callback interface satisfies static analysis while retaining the same protocol contract. src/agenticfleet/fleet/callbacks.pyL17-L42

Testing

  • uv run pytest
  • uv run ruff check .
  • uv run mypy .

View task →

…" 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.
@Zochory Zochory merged commit bf0bdad into main Oct 16, 2025
12 checks passed
@Zochory Zochory deleted the agent-framework-fallback branch October 16, 2025 08:40
@github-project-automation github-project-automation bot moved this from Backlog to Done in AgenticFleet Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Agent-related code area: cli Command-line interface area: config Configuration system area: memory Memory/context provider dependencies Dependency updates python Python-related changes type: documentation Improvements or additions to documentation type: test Test-related changes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Release 0.5.1 - Feature Enhancements and Bug Fixes

3 participants