-
Notifications
You must be signed in to change notification settings - Fork 9
feat: major API improvements, local Transformers support, and bug fixes #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When users provide custom engines via .with_engines() or custom utilities via .with_utilities(), the orchestrator's no_output flag was not being propagated to them, causing terminal output despite no_output=True. Changes: - Add no_output field to AgentComponent base class (inherited by all) - Propagate no_output to user-provided engines in _resolve_engines() - Propagate no_output to user-provided utilities in _resolve_utilities() - Update tests to expect correct propagation behavior
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #370 +/- ##
==========================================
+ Coverage 83.60% 83.64% +0.03%
==========================================
Files 144 144
Lines 9225 9245 +20
Branches 1170 1174 +4
==========================================
+ Hits 7713 7733 +20
Misses 1212 1212
Partials 300 300
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 25
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Add convenient top-level imports for frequently used classes: - Engines: DSPyEngine, BAMLAdapter, JSONAdapter, XMLAdapter, ChatAdapter, TwoStepAdapter - Components: AgentComponent, EngineComponent, OrchestratorComponent - Runtime: Context, EvalInputs, EvalResult - Artifacts: Artifact - Visibility: PublicVisibility, PrivateVisibility, Visibility, etc. - Conditions: Until - Subscriptions: BatchSpec, JoinSpec, ScheduleSpec - Store: FilterConfig Users can now do: from flock import Flock, DSPyEngine, BAMLAdapter, AgentComponent
| if self.engines: | ||
| # Propagate no_output to user-provided engines | ||
| for engine in self.engines: | ||
| engine.no_output = self.no_output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Shared engine mutation causes race conditions
Mutating no_output on user-provided engines and utilities creates race conditions when the same instance is shared across multiple agents with different no_output settings. The documentation explicitly supports reusing engines across agents, but concurrent execution will cause unpredictable behavior as agents overwrite each other's no_output values. This affects both _resolve_engines() and _resolve_utilities().
Additional Locations (1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is expected behavior, not a bug. The orchestrator's no_output setting should take precedence - that's the whole point of propagation. If users want different settings per agent, they should use different engine instances. Sharing the same engine instance across agents with conflicting settings is a user design error.
uv.lock
Outdated
| [[package]] | ||
| name = "flock-core" | ||
| version = "0.5.311" | ||
| version = "0.5.312" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was on an intermediate commit. The version has been bumped multiple times since then (now at 0.5.318) and uv.lock is regenerated automatically on each uv sync. Not a real issue.
New documentation: - guides/imports.md: Comprehensive guide for top-level imports (DSPyEngine, adapters, components, Context, etc.) - guides/local-models.md: Guide for running Flock with Hugging Face Transformers models locally without API keys - guides/silent-mode.md: Guide for the no_output flag when running as a service Also fixes: - mkdocs.yml: Reorganized nav to include ALL existing guides that were missing: - DSPy Engine Deep Dive - Timer Scheduling - Webhook Notifications - Workflow Control - MCP Roots - Scheduled Agents tutorial - Connect with Ollama tutorial - Created missing getting-started/server-components-concepts.md - Updated guides/index.md with new cards for engines and imports This should fix the "half of docs are missing" issue - guides existed but weren't in the navigation.
Added missing exports: - When: DSL for subscription activation conditions - ServerComponent: Base class for custom HTTP server components - ServerComponentConfig: Configuration for server components Also improved docs/guides/imports.md: - Every import now has a "Learn More" column linking to relevant docs - Added navigation buttons to jump to detailed guides - Added When to workflow control section with example
Added logging utilities to top-level namespace: - get_logger: Get a Flock logger instance for your module - configure_logging: Configure logging level and formatting Now you can do: from flock import get_logger, configure_logging logger = get_logger(__name__)
When using .with_engines(DSPyEngine(adapter=...)) without specifying a
model, the engine would fall back to DEFAULT_MODEL env var instead of
inheriting the model from the Flock constructor.
Now custom engines without an explicit model will inherit the
orchestrator's model:
flock = Flock("transformers/my-model")
agent = flock.agent("x").with_engines(DSPyEngine(adapter=JSONAdapter()))
# Engine now uses "transformers/my-model" instead of DEFAULT_MODEL
Engines with explicit models are unchanged - they keep their specified model.
Fixed inconsistency where the default utility component only had config.no_output set but not the component's own no_output field. Now both fields are set for consistency with how custom utilities are handled. Fixes Bugbot review comment on PR #370.
Summary
This PR includes several significant improvements:
🐛 Bug Fixes
no_outputto custom engines and utilities - When using.with_engines()or.with_utilities(), the orchestrator'sno_outputflag was not propagatedDSPyEngine(adapter=...)without a model, it now inherits fromFlock(model=...)instead of falling back toDEFAULT_MODELenv var✨ New Features
Flock("transformers/model-name")no_outputflag - Suppress terminal output when running as a service:Flock(no_output=True)📚 Documentation
docs/guides/imports.md)docs/guides/local-models.md)docs/guides/silent-mode.md)server-components-concepts.mdTest Plan
no_outputpropagation (17 tests)Note
Exposes a rich top-level API, adds Hugging Face Transformers local model support, propagates silent
no_outputand orchestrator model to custom engines/utilities, and updates docs/navigation.src/flock/__init__.py(engines, components, runtime types, visibility, conditions, subscriptions, logging) with optional Transformers provider auto-registration.no_outputtoAgentComponent; propagateno_outputto engines/utilities inAgent._resolve_engines/_resolve_utilities.modelto custom engines lacking a model in_resolve_engines.DSPyEngineconstruction carriesno_outputand model from orchestrator.guides/imports.md,guides/local-models.md,guides/silent-mode.md; addgetting-started/server-components-concepts.md.guides/index.mdandmkdocs.ymlnavigation (new sections: Core, Components, Engines, Subscriptions, Publishing, Advanced, Operations; add tutorials/examples links).no_outputpropagation and model inheritance for custom engines/utilities.0.5.318.Written by Cursor Bugbot for commit d95319c. This will update automatically on new commits. Configure here.