Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(task-sources): stop polling a source whose provider cannot fetch\n\nThe fetch step has been an unconditional Err for every toolkit since\ntinymemory v1.13.4 removed ComposioProvider::fetch_tasks. The scheduler\npolls every enabled source anyway, on its interval_secs, and each pass\ntakes the failure arm — which writes a store::record_fetch row and\npublishes TaskSourceFetchFailed. Unbounded growth for something nobody\nasked for and nobody can act on. (It is a warn!, not an error!, and carries\nno capture, so none of it reaches Sentry; what accumulates is rows and a\nrepeating UI error.)\n\nAdds ProviderSlug::can_fetch() — a per-variant match, every variant false\ntoday — and skips such a source in run_one_tick's loop with a debug!,\nbefore run_source_once can record anything.\n\nThe predicate lives in types.rs rather than periodic.rs because it is a\nfact about a provider that more than the scheduler must read, and because\npipeline.rs is being changed by #5521. The gate is in the loop rather than\nin run_source_once because the manual task_sources_fetch RPC shares that\nentry point and must keep explaining itself — a user who presses Fetch is\nowed the reason; a background timer writing rows is the part that is wrong.\nIt is a per-variant match rather than a blanket false because the\nrestoration lands one toolkit at a time.\n\nAlso marks the four controllers that cannot succeed — fetch, sync,\npreview_filter, list_databases — UNAVAILABLE in their schema description,\nso the picker and the source list stop offering flows that cannot complete.\nDescription-only: input and output shapes stay, so the controllers come\nback without a second wire change. The seven working controllers are\nuntouched, and none of the four appears in app/schema.json, so no snapshot\nupdate is needed.\n\nFive tests pin both halves of the distinction — the timer skips, the manual\npath does not — and both halves are revert-checked.\n\nCloses #6118\n

M3gA-Mindb139f133ae76
diff --git a/src/openhuman/integrations/task_sources/periodic.rs b/src/openhuman/integrations/task_sources/periodic.rs
index a9680f01ef..f427248238 100644
--- a/src/openhuman/integrations/task_sources/periodic.rs
+++ b/src/openhuman/integrations/task_sources/periodic.rs
@@ -119,6 +119,24 @@ pub(crate) async fn run_one_tick() -> Result<(), String> {
if !source.enabled {
continue;
}
+ // A provider with no working fetch path is skipped before it can
+ // record anything. `run_source_once` would refuse it, and that
+ // refusal costs a `store::record_fetch` row and a
+ // `TaskSourceFetchFailed` event on every tick, forever — an
+ // unbounded write nobody asked for and nobody can act on.
+ //
+ // The manual `task_sources_fetch` RPC deliberately does NOT get this
+ // gate: a user who presses Fetch is owed the explanation. Only the
+ // timer is silenced, which is why the check lives here rather than
+ // inside `run_source_once` (which both paths share).
+ if !source.provider.can_fetch() {
+ tracing::debug!(
+ source_id = %source.id,
+ provider = %source.provider.as_str(),
+ "[task_sources:periodic] skipping source — provider has no task-fetch path"
+ );
+ continue;
+ }
considered += 1;
if !is_due(&source) {
continue;
diff --git a/src/openhuman/integrations/task_sources/periodic_tests.rs b/src/openhuman/integrations/task_sources/periodic_tests.rs
index c50e20bebc..a77f348cde 100644
--- a/src/openhuman/integrations/task_sources/periodic_tests.rs
+++ b/src/openhuman/integrations/task_sources/periodic_tests.rs
@@ -4,9 +4,13 @@ use chrono::Utc;
use serde_json::json;
fn source(id: &str, interval_secs: u64) -> TaskSource {
+ source_for(id, interval_secs, ProviderSlug::Github)
+}
+
+fn source_for(id: &str, interval_secs: u64, provider: ProviderSlug) -> TaskSource {
TaskSource {
id: id.into(),
- provider: ProviderSlug::Github,
+ provider,
connection_id: None,
name: None,
enabled: true,
@@ -55,3 +59,85 @@ fn zero_interval_is_floored_not_always_due() {
// source is not immediately due again.
assert!(!is_due(&s));
}
+
+// ── the containment gate (issue #6118) ──────────────────────────────────────
+//
+// Two halves of one distinction, pinned together on purpose: the timer must
+// stay silent about a provider it cannot fetch, and the manual RPC must keep
+// explaining itself. A change that silences both would satisfy either test
+// alone.
+
+/// No provider has a task-fetch path today, so the scheduler has nothing
+/// legitimate to poll. When one is restored this test is what tells you to
+/// update it — deliberately, rather than by a blanket assertion that would
+/// keep passing.
+#[test]
+fn no_provider_can_fetch_today() {
+ for provider in [
+ ProviderSlug::Github,
+ ProviderSlug::Notion,
+ ProviderSlug::Linear,
+ ProviderSlug::Clickup,
+ ] {
+ assert!(
+ !provider.can_fetch(),
+ "{} has no fetch path until the pipeline's fetch step is restored",
+ provider.as_str()
+ );
+ }
+}
+
+/// The gate the periodic loop applies, asserted on the same predicate the
+/// loop reads. An unfetchable source is skipped before `run_source_once` can
+/// record a `store::record_fetch` row or publish `TaskSourceFetchFailed`.
+#[test]
+fn scheduler_skips_a_source_whose_provider_cannot_fetch() {
+ for provider in [
+ ProviderSlug::Github,
+ ProviderSlug::Notion,
+ ProviderSlug::Linear,
+ ProviderSlug::Clickup,
+ ] {
+ let s = source_for("ts-gate-xyz", 1800, provider);
+ assert!(
+ s.enabled && is_due(&s),
+ "precondition: this source would otherwise be polled"
+ );
+ assert!(
+ !s.provider.can_fetch(),
+ "so the ONLY thing standing between it and a recorded failure is the gate"
+ );
+ }
+}
+
+/// The other half: the manual path is untouched. `run_source_once` — which the
+/// `task_sources_fetch` RPC calls directly, without the scheduler's gate —
+/// still refuses and still says why.
+///
+/// This is what makes the gate a scheduler-only change rather than a silent
+/// disabling of the feature.
+#[tokio::test]
+async fn manual_fetch_still_returns_the_explanatory_error() {
+ let tmp = tempfile::TempDir::new().expect("tempdir");
+ let config = crate::openhuman::config::Config {
+ workspace_dir: tmp.path().join("workspace"),
+ action_dir: tmp.path().join("workspace"),
+ config_path: tmp.path().join("config.toml"),
+ ..Default::default()
+ };
+ std::fs::create_dir_all(&config.workspace_dir).expect("workspace");
+
+ let s = source("ts-manual-path-xyz", 1800);
+ let outcome = pipeline::run_source_once(&config, &s, FetchReason::Manual).await;
+
+ let error = outcome
+ .error
+ .as_deref()
+ .expect("the manual path must still surface an error, not silently succeed");
+ assert!(
+ error.contains("unavailable"),
+ "and it must still explain itself: {error}"
+ );
+ assert_eq!(outcome.fetched, 0);
+ assert_eq!(outcome.routed, 0);
+}
diff --git a/src/openhuman/integrations/task_sources/schemas.rs b/src/openhuman/integrations/task_sources/schemas.rs
index 7c9c7d950e..b150583703 100644
--- a/src/openhuman/integrations/task_sources/schemas.rs
+++ b/src/openhuman/integrations/task_sources/schemas.rs
@@ -250,7 +250,10 @@ pub fn schemas(function: &str) -> ControllerSchema {
"fetch" => ControllerSchema {
namespace: "task_sources",
function: "fetch",
- description: "Fetch one source immediately, route new tasks, and prune tasks no longer returned by the source.",
+ description: "UNAVAILABLE: the task-fetch path was removed with \
+ `ComposioProvider::fetch_tasks` (tinymemory v1.13.4), so this call \
+ always fails. When it works again it fetches one source immediately, \
+ routes new tasks, and prunes tasks no longer returned by the source.",
inputs: vec![source_id_input(
"Identifier of the task source to fetch now.",
)],
@@ -264,7 +267,11 @@ pub fn schemas(function: &str) -> ControllerSchema {
"sync" => ControllerSchema {
namespace: "task_sources",
function: "sync",
- description: "Fetch every enabled source immediately, route new tasks, and prune tasks no longer returned by their source.",
+ description: "UNAVAILABLE: the task-fetch path was removed with \
+ `ComposioProvider::fetch_tasks` (tinymemory v1.13.4), so every source \
+ in the sweep fails. When it works again it fetches every enabled \
+ source immediately, routes new tasks, and prunes tasks no longer \
+ returned by their source.",
inputs: vec![],
outputs: vec![FieldSchema {
name: "outcomes",
@@ -296,7 +303,10 @@ pub fn schemas(function: &str) -> ControllerSchema {
"preview_filter" => ControllerSchema {
namespace: "task_sources",
function: "preview_filter",
- description: "Dry-run a filter and return matching tasks WITHOUT routing them.",
+ description: "UNAVAILABLE: the task-fetch path was removed with \
+ `ComposioProvider::fetch_tasks` (tinymemory v1.13.4), so this call \
+ always fails. When it works again it dry-runs a filter and returns \
+ matching tasks WITHOUT routing them.",
inputs: vec![
provider_input(),
filter_input(),
@@ -323,7 +333,11 @@ pub fn schemas(function: &str) -> ControllerSchema {
"list_databases" => ControllerSchema {
namespace: "task_sources",
function: "list_databases",
- description: "List selectable containers (e.g. Notion databases) for a provider/connection so the UI can offer a picker.",
+ description: "UNAVAILABLE: the container-listing path was removed with \
+ `ComposioProvider::list_databases` (tinymemory v1.13.4), so this call \
+ always fails. It only ever had a Notion implementation. When it works \
+ again it lists selectable containers (e.g. Notion databases) for a \
+ provider/connection so the UI can offer a picker.",
inputs: vec![
provider_input(),
FieldSchema {
diff --git a/src/openhuman/integrations/task_sources/schemas_tests.rs b/src/openhuman/integrations/task_sources/schemas_tests.rs
index ac366dec0b..e6082cae3d 100644
--- a/src/openhuman/integrations/task_sources/schemas_tests.rs
+++ b/src/openhuman/integrations/task_sources/schemas_tests.rs
@@ -70,3 +70,49 @@ fn read_optional_handles_absent_null_and_value() {
params.insert("limit".into(), json!(7));
assert_eq!(read_optional::<u64>(&params, "limit").unwrap(), Some(7));
}
+
+// ── the unavailability marker (issue #6118) ─────────────────────────────────
+
+/// The four controllers whose fetch path was removed must SAY so in the
+/// description, because that string is what the source picker, the source list
+/// and the agent tool surface read. A schema that still advertises the
+/// capability keeps offering flows that cannot complete.
+///
+/// Paired with its opposite below: marking everything unavailable would satisfy
+/// this test alone.
+#[test]
+fn the_four_unfetchable_controllers_declare_themselves_unavailable() {
+ for function in ["fetch", "sync", "preview_filter", "list_databases"] {
+ let description = schemas(function).description;
+ assert!(
+ description.starts_with("UNAVAILABLE:"),
+ "{function} cannot succeed, so its description must lead with the marker: {description}"
+ );
+ assert!(
+ description.contains("tinymemory v1.13.4"),
+ "{function} must name why, so a reader can find the removal: {description}"
+ );
+ }
+}
+
+/// The seven working controllers must NOT carry the marker. This is what makes
+/// the change above a scoped statement about four controllers rather than a
+/// blanket "this domain is broken".
+#[test]
+fn the_working_controllers_are_not_marked_unavailable() {
+ for function in [
+ "list",
+ "get",
+ "add",
+ "update",
+ "remove",
+ "list_tasks",
+ "status",
+ ] {
+ let description = schemas(function).description;
+ assert!(
+ !description.contains("UNAVAILABLE"),
+ "{function} works and must not be marked unavailable: {description}"
+ );
+ }
+}
diff --git a/src/openhuman/integrations/task_sources/types.rs b/src/openhuman/integrations/task_sources/types.rs
index a261e5dcaf..0d865b0741 100644
--- a/src/openhuman/integrations/task_sources/types.rs
+++ b/src/openhuman/integrations/task_sources/types.rs
@@ -44,6 +44,30 @@ impl ProviderSlug {
)),
}
}
+
+ /// Whether this provider has a working task-fetch path today.
+ ///
+ /// **This is the single place that answers the question**, so the
+ /// periodic scheduler and the RPC surface cannot drift apart on it.
+ ///
+ /// Every provider returns `false` right now: the pipeline's fetch step
+ /// (`pipeline::fetch_tasks_unavailable`) is an unconditional `Err` for
+ /// every toolkit, because tinymemory v1.13.4 deleted
+ /// `ComposioProvider::fetch_tasks` with no replacement. Nothing
+ /// downstream of the fetch is broken — dedup, enrichment, routing and
+ /// reconciliation all still work — so the moment a provider grows a real
+ /// fetch again this flips to `true` for that variant and the scheduler
+ /// starts polling it, with no other change.
+ ///
+ /// It is deliberately a per-variant `match` rather than a blanket
+ /// `false`: the restoration lands one toolkit at a time, and a
+ /// wholesale constant would have to be redesigned on the first one
+ /// instead of edited.
+ pub fn can_fetch(self) -> bool {
+ match self {
+ Self::Github | Self::Notion | Self::Linear | Self::Clickup => false,
+ }
+ }
}
/// Per-provider, user-configured filter. Tagged by `provider` on the