We discovered that Chain.connect() predicates do NOT prevent link execution in linear pipelines. All links execute regardless of predicate evaluation.
Expected Behavior:
When a predicate returns False, the target link should be skipped.
Actual Behavior:
All links run regardless of predicate conditions.
Solution Pattern:
Conditional logic must be implemented INSIDE Links using return statements:
class MyLink(Link):
async def call(self, ctx):
if skip_condition:
return ctx # Skip operation
# ... proceed with logic ...
return ctx
Questions:
- Is this intentional design (predicates are metadata/documentation only)?
- Are predicates intended only for DAG routing, not linear chain gating?
- Should this be documented more clearly?
Context:
We discovered this pattern while building a multi-calendar scheduling system with CodeUChain. We initially tried using predicates to gate event creation when availability slots are empty, but found that predicates don't actually prevent link execution in linear chains.
Reference Implementation:
https://github.com/JoshuaWink/random-research-journal/blob/main/implementations/calendar-workflow/FIX_AVAILABILITY_GATING.md
Environment:
- CodeUChain: 1.0.0+
- Python: 3.11
We discovered that Chain.connect() predicates do NOT prevent link execution in linear pipelines. All links execute regardless of predicate evaluation.
Expected Behavior:
When a predicate returns False, the target link should be skipped.
Actual Behavior:
All links run regardless of predicate conditions.
Solution Pattern:
Conditional logic must be implemented INSIDE Links using return statements:
Questions:
Context:
We discovered this pattern while building a multi-calendar scheduling system with CodeUChain. We initially tried using predicates to gate event creation when availability slots are empty, but found that predicates don't actually prevent link execution in linear chains.
Reference Implementation:
https://github.com/JoshuaWink/random-research-journal/blob/main/implementations/calendar-workflow/FIX_AVAILABILITY_GATING.md
Environment: