Skip to content

[upstream-sync] Component run_in_background() error callback (upstream PR #1754) #136

@github-actions

Description

@github-actions

Upstream Change Summary

Type: new-feature
Difficulty: Medium
Recommendation: Adapt

Upstream PR #1754 adds scope-level and environment-level exception handlers for background mount() failures. The Rust core change is in rust/core/src/engine/component.rs: Component::run_in_background() now accepts an optional async on_error callback instead of unconditionally logging errors. This is a meaningful API extension to the component execution engine.

The broader Python-side exception handler chaining (ExceptionContext, ExceptionHandler, coco.exception_handler()) is irrelevant to recoco, but the Rust signature change to run_in_background() may affect recoco's component API and background execution model.

Upstream References

Relevant Upstream Files / Areas

  • rust/core/src/engine/component.rscrates/recoco-core/src/execution/ component module
  • rust/py/src/component.rsskip (PyO3 bindings)
  • All other files (python/, docs/) → skip

Recoco Considerations

  • Affected modules: crates/recoco-core component execution, specifically run_in_background()
  • Python exclusions: Do not port ExceptionContext, ExceptionHandler, coco.exception_handler(), EnvironmentBuilder.set_exception_handler(), or any Python API surface
  • Adaptation needed: The run_in_background() signature change should be adopted in pure-Rust form — likely as an optional on_error: Option<impl FnOnce(Error) + Send + 'static> callback or a more idiomatic Rust error-channel approach
  • API surface impact: If run_in_background() or background component execution is exposed in recoco's public API, this may require a minor version bump
  • Feature-gating: No new ops, no new feature gate needed
  • Opportunity: Consider whether recoco should expose a richer error-handling API for background flows (e.g., returning a JoinHandle or using a broadcast channel for errors) rather than mirroring the callback pattern

Integration Notes

The key question is whether recoco's run_in_background() equivalent currently swallows errors or propagates them. If it already returns a JoinHandle<Result<...>>, this upstream change may be partially covered. Review the current implementation before adopting. The Python-specific handler chaining logic should be entirely omitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    claudeCreated or actioned by Claude AIupstream-syncIssues for syncing updates with our upstream (cocoindex-io/cocoindex)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions