The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(task-sources): mark the dead agent tools, and test the gate through the scheduler\n\nTwo review findings on #6135, both correct.\n\nThe scheduler test asserted on `ProviderSlug::can_fetch()` and never on\n`run_one_tick`, so deleting the guard from the loop would have left it\ngreen — the exact regression the PR exists to prevent. The original\nrevert-check could not see this: inverting `can_fetch()` breaks a\npredicate assertion whether or not the loop consults it.\n\n`a_tick_over_an_unfetchable_source_records_nothing` replaces it. It\npersists a real enabled source, asserts the preconditions (enabled, due,\ncannot fetch) so the gate is provably the only thing in the way, drives\nthe real `run_one_tick()`, and asserts `last_fetch_at` and `last_status`\nare both still None. Those are the columns `store::record_fetch` writes\nfrom the failure arm of `run_source_once`, so both staying None is proof\nthe source was skipped before that arm could run. The config is scoped\nthrough `CoreContext::for_test_with_config` — the seam\n`load_config_with_timeout()` prefers — so the tick reads a temp\nworkspace with no HOME mutation and no race with parallel lib tests.\n\nSeparately, `Tool::description()` is an independent hard-coded string,\nso the ControllerSchema descriptions amended in the first commit never\nreached the agent surface: a model choosing a tool still read a\nrecommendation to call something that always fails. TaskSourceFetchTool\nand TaskSourcePreviewFilterTool now carry the same UNAVAILABLE marker\n(there is no agent tool for sync or list_databases, so 2 of the 4).\nTests pin both directions, so this cannot become "the whole domain is\ndead".\n\nThe frontend buttons in TaskSourceControls.tsx are still offered and\nstill fail. Closing that needs an availability signal the RPC surface\ndoes not expose — a `canFetch` field on `task_sources_status` is the\nnatural shape — which is a wire change plus React and i18n work, and\ndoes not belong in a containment PR that changes no shapes. Raised as a\nfollow-up on the thread.\n\nVerified by removing the guard from run_one_tick with can_fetch() left\nreturning false: the new test fails with "the tick must not have stamped\na fetch time: Some(2026-09-08T16:41:43Z)". 68 tests pass restored.\n
M3gA-Mindb3be95ba42a2
diff --git a/src/openhuman/integrations/task_sources/periodic_tests.rs b/src/openhuman/integrations/task_sources/periodic_tests.rsindex a77f348cde..a6f56909cb 100644--- a/src/openhuman/integrations/task_sources/periodic_tests.rs+++ b/src/openhuman/integrations/task_sources/periodic_tests.rs@@ -87,27 +87,89 @@ fn no_provider_can_fetch_today() {}}-/// 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 [+/// Drives a real `run_one_tick` over a persisted, enabled, due source whose+/// provider cannot fetch, and asserts the tick recorded **nothing**.+///+/// The observable is the source row itself: the failure arm of+/// `pipeline::run_source_once` calls `store::record_fetch`, which stamps+/// `last_fetch_at` and `last_status`. Both staying `None` after a tick is+/// proof the source was skipped before `run_source_once` ran.+///+/// This asserts through the scheduler rather than on the predicate, on+/// purpose: a test that only checked `can_fetch()` would still pass if the+/// guard were deleted from `run_one_tick`, which is the exact regression this+/// PR exists to prevent.+///+/// The config is scoped onto the embedder seam that `load_config_with_timeout`+/// prefers, so the tick reads this workspace instead of doing live, racy disk+/// I/O against `~/.openhuman` — the same approach as `sandbox/schemas_tests.rs`.+#[tokio::test]+async fn a_tick_over_an_unfetchable_source_records_nothing() {+ use crate::core::runtime::context::CoreContext;+ use crate::core::runtime::DomainSet;++ let tmp = tempfile::TempDir::new().expect("tempdir");+ let workspace = tmp.path().join("workspace");+ std::fs::create_dir_all(&workspace).expect("workspace");+ let config = crate::openhuman::config::Config {+ workspace_dir: workspace.clone(),+ action_dir: workspace,+ config_path: tmp.path().join("config.toml"),+ ..Default::default()+ };+ assert!(+ config.task_sources.enabled,+ "precondition: the domain must be on, or the tick returns before the loop"+ );++ // `add_source` mints the id, and it is fresh per run — so the+ // process-global last-poll map cannot make this source look recently+ // polled because of another test.+ let stored = super::super::store::add_source(+ &config,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"- );- }+ None,+ None,+ FilterSpec::Github {+ repo: None,+ labels: vec![],+ assignee_is_me: true,+ state: None,+ fetch_mode: Default::default(),+ extra: json!({}),+ },+ 1800,+ SourceTarget::TodoOnly,+ 25,+ )+ .expect("persist the source");+ let id = stored.id.clone();++ assert!(stored.enabled, "precondition: the source is enabled");+ assert!(is_due(&stored), "precondition: the source is due");+ assert!(+ !stored.provider.can_fetch(),+ "precondition: its provider has no fetch path, so the gate must skip it"+ );++ CoreContext::scope(+ CoreContext::for_test_with_config(DomainSet::full(), config.clone()),+ run_one_tick(),+ )+ .await+ .expect("a tick must not fail");++ let after = super::super::store::get_source(&config, &id).expect("re-read the source");+ assert!(+ after.last_fetch_at.is_none(),+ "the tick must not have stamped a fetch time: {:?}",+ after.last_fetch_at+ );+ assert!(+ after.last_status.is_none(),+ "and must not have recorded a status — a recorded failure is the bug: {:?}",+ after.last_status+ );}/// The other half: the manual path is untouched. `run_source_once` — which thediff --git a/src/openhuman/integrations/task_sources/tools.rs b/src/openhuman/integrations/task_sources/tools.rsindex 69a7efe332..56d894002e 100644--- a/src/openhuman/integrations/task_sources/tools.rs+++ b/src/openhuman/integrations/task_sources/tools.rs@@ -161,10 +161,11 @@ impl Tool for TaskSourceFetchTool {}fn description(&self) -> &str {- "Fetch one task source now (by `id`) instead of waiting for its poll \- interval. Returns counts of tasks fetched, newly routed, and skipped \- as duplicates. Use when the user wants the latest issues/tasks pulled \- immediately."+ "UNAVAILABLE: the task-fetch path was removed with \+ `ComposioProvider::fetch_tasks` (tinymemory v1.13.4), so this call always fails — \+ do not call it. When it works again it fetches one task source now (by `id`) \+ instead of waiting for its poll interval, returning counts of tasks fetched, \+ newly routed, and skipped as duplicates."}fn parameters_schema(&self) -> serde_json::Value {@@ -253,10 +254,11 @@ impl Tool for TaskSourcePreviewFilterTool {}fn description(&self) -> &str {- "Dry-run a task-source `filter` for a `provider` and return the tasks \- it would match, WITHOUT creating a persistent source or ingesting \- anything. Use to validate a filter before `task_source_add`. The \- `filter` object is provider-tagged (e.g. \+ "UNAVAILABLE: the task-fetch path was removed with \+ `ComposioProvider::fetch_tasks` (tinymemory v1.13.4), so this call always fails — \+ do not call it. When it works again it dry-runs a task-source `filter` for a \+ `provider` and returns the tasks it would match, WITHOUT creating a persistent \+ source or ingesting anything. The `filter` object is provider-tagged (e.g. \`{ \"provider\": \"github\", \"repo\": \"owner/name\", \"labels\": [\"bug\"] }`)."}diff --git a/src/openhuman/integrations/task_sources/tools_tests.rs b/src/openhuman/integrations/task_sources/tools_tests.rsindex 896537c0aa..02ddbd8b4d 100644--- a/src/openhuman/integrations/task_sources/tools_tests.rs+++ b/src/openhuman/integrations/task_sources/tools_tests.rs@@ -61,3 +61,44 @@ fn parse_provider_rejects_unknown() {let err = parse_provider(&json!({ "provider": "jira" })).expect_err("unknown provider");assert!(err.to_string().contains("provider"));}++// ── the unavailability marker on the agent surface (issue #6118) ────────────++/// The two agent tools backed by the dead fetch path must declare themselves+/// unavailable in their **own** `description()`.+///+/// The `ControllerSchema` descriptions amended alongside this do not reach+/// here: `Tool::description` is an independent hard-coded string, so a model+/// choosing a tool reads this and nothing else. Without the marker the agent+/// is still advised to call something that deterministically fails.+#[test]+fn the_two_dead_agent_tools_declare_themselves_unavailable() {+ let fetch = TaskSourceFetchTool::new(cfg());+ assert!(+ fetch.description().starts_with("UNAVAILABLE:"),+ "task_source_fetch cannot succeed: {}",+ fetch.description()+ );+ let preview = TaskSourcePreviewFilterTool::new(cfg());+ assert!(+ preview.description().starts_with("UNAVAILABLE:"),+ "task_source_preview_filter cannot succeed: {}",+ preview.description()+ );+}++/// The agent tools that still work must NOT carry the marker — the same+/// both-directions check the schema tests make, so this cannot degenerate into+/// marking the whole domain dead.+#[test]+fn the_working_agent_tools_are_not_marked_unavailable() {+ assert!(!TaskSourceListTool::new(cfg())+ .description()+ .contains("UNAVAILABLE"));+ assert!(!TaskSourceStatusTool::new(cfg())+ .description()+ .contains("UNAVAILABLE"));+ assert!(!TaskSourceAddTool::new(cfg())+ .description()+ .contains("UNAVAILABLE"));+}