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(test): assert the shipped /skills redirect, and make the TinyBus peel reachable
M3gA-Mind4e3e1c093ba2
diff --git a/app/test/playwright/specs/route-redirect-history.spec.ts b/app/test/playwright/specs/route-redirect-history.spec.tsindex 16f59746df..1c0c616691 100644--- a/app/test/playwright/specs/route-redirect-history.spec.ts+++ b/app/test/playwright/specs/route-redirect-history.spec.ts@@ -111,20 +111,25 @@ test.describe('The /channels redirect carries its tab selector through a real naawait expect.poll(() => hash(page)).toContain('tab=messaging');});- test('/skills?tab=… currently DROPS the query — pinned, see W5 BUG-1', async ({ page }) => {- // `AppRoutes.tsx` claims twice that this redirect "preserves ?tab= deep- // links". It does not: `<Navigate to="/connections" replace />` takes a- // bare path string with no search component. The knock-on is that the- // legacy alias table in `pages/Skills.tsx` — written, per its own comment,- // so `/skills?tab=composio` keeps working after the redirect — is- // unreachable from this route.+ test('/skills?tab=… carries the deep link through the redirect', async ({ page }) => {+ // `AppRoutes.tsx` says this redirect "preserves ?tab= deep links", and as of+ // `d434f1e0f` it does: `/skills` is `<ForwardSearch to="/connections" />`,+ // which copies `search` and `hash` onto the target rather than dropping them+ // the way a bare `<Navigate to="/connections" />` did.//- // Pinned as CURRENT behaviour so it cannot deepen unnoticed. When it is- // fixed, flip this to expect `tab=messaging` and delete the note.+ // This assertion used to be inverted — it pinned the pre-fix behaviour+ // (`not.toContain('tab=messaging')`) and was written 94 minutes AFTER the+ // fix landed, so it passed only while the bug was present and would have+ // gone green through the exact regression it names. Asserting the shipped+ // behaviour is what makes it a regression test.+ //+ // `messaging` is a legacy alias that `Skills.tsx` maps to the `channels`+ // tab, so the URL keeping the raw value is the contract under test here;+ // `connections-tab-aliases.spec.ts` covers what it then resolves to.await page.goto('/#/skills?tab=messaging');await waitForAppReady(page);await expect.poll(() => hash(page)).toMatch(/^#\/connections/);- await expect.poll(() => hash(page)).not.toContain('tab=messaging');+ await expect.poll(() => hash(page)).toContain('tab=messaging');});});diff --git a/src/openhuman/integrations/composio/module_client.rs b/src/openhuman/integrations/composio/module_client.rsindex ec5d4edf54..f6fecd6037 100644--- a/src/openhuman/integrations/composio/module_client.rs+++ b/src/openhuman/integrations/composio/module_client.rs@@ -38,11 +38,26 @@ pub fn is_unsupported_by_route(error: &str) -> bool {/// Keep the structured Composio classification at the start of the error.///-/// TinyBus prefixes member failures twice — the member name (`Execute: `) and,-/// since the module extraction, the wire error name-/// (`ai.tinyhumans.tinybus.Error.Failed: `) — but the frontend parser-/// intentionally requires the classification at byte zero. Both layers are-/// peeled before checking; other errors retain their full context unchanged.+/// TinyBus prefixes a member failure with the member name (`Execute: `) and,+/// since the module extraction, with its wire error name+/// (`ai.tinyhumans.tinybus.Error.<Kind>: `) — but the frontend parser+/// intentionally requires the classification at byte zero, so every transport+/// layer is peeled before checking. Errors that are not classified retain their+/// full context unchanged.+///+/// # Why the wire layer is peeled in a loop+///+/// It used to be peeled once, with a second `strip_prefix` afterwards as a+/// fallback for `Error.Failed: ` specifically. That fallback could not fire for+/// the shape its comment described: the single peel above it already consumed+/// `Error.Failed: `, so the branch was reachable only by a *doubly* wire-wrapped+/// error — which nothing documented, and which the fallback's own comment did+/// not claim to handle. Nesting depth is a property of the transport, not+/// something this function should hardcode a guess at, so it now strips as many+/// layers as are present. Output is unchanged for every shape the old form+/// handled, including the double wrap the fallback did catch; a triple or deeper+/// wrap, which the old form silently passed through unnormalised (and so+/// reported to the user as an unclassified outage), now normalises too.fn normalize_error(member: &str, error: String) -> String {const CLASSIFIED: &str = "[composio:error:";const WIRE_ERROR_PREFIX: &str = "ai.tinyhumans.tinybus.Error.";@@ -50,29 +65,21 @@ fn normalize_error(member: &str, error: String) -> String {.strip_prefix(member).and_then(|remainder| remainder.strip_prefix(": ")){- // Optionally peel the bus wire-name layer: `ai.tinyhumans.tinybus.- // Error.<Kind>: `. `<Kind>` is a bare identifier, so the next `: `- // ends it; anything shaped differently is left alone.- let module_error = remainder+ // Peel each `ai.tinyhumans.tinybus.Error.<Kind>: ` layer. `<Kind>` is a+ // bare identifier, so the next `: ` ends it; anything shaped differently+ // stops the loop and is left alone. An embedded marker that does NOT+ // follow a wire prefix is never promoted — the `starts_with` below is+ // what decides, and it runs on the fully-peeled remainder only.+ let mut module_error = remainder;+ while let Some(tail) = module_error.strip_prefix(WIRE_ERROR_PREFIX).and_then(|rest| rest.split_once(": ").map(|(_, tail)| tail))- .unwrap_or(remainder);+ {+ module_error = tail;+ }if module_error.starts_with(CLASSIFIED) {return module_error.to_string();}- // Recent TinyBus versions wrap member failures in their wire error- // name before preserving the module's message:- // `Execute: ai.tinyhumans.tinybus.Error.Failed: [composio:error:…]`.- // That wrapper is transport context, not provider text, so retain the- // frontend's byte-zero classification contract exactly as for the- // older unwrapped shape. Do not promote an arbitrary embedded marker:- // it must follow this known TinyBus failure prefix.- const TINYBUS_FAILED: &str = "ai.tinyhumans.tinybus.Error.Failed: ";- if let Some(classified) = module_error.strip_prefix(TINYBUS_FAILED) {- if classified.starts_with(CLASSIFIED) {- return classified.to_string();- }- }}error}diff --git a/src/openhuman/integrations/composio/module_client_tests.rs b/src/openhuman/integrations/composio/module_client_tests.rsindex f323370f5a..b5e9155ab6 100644--- a/src/openhuman/integrations/composio/module_client_tests.rs+++ b/src/openhuman/integrations/composio/module_client_tests.rs@@ -24,6 +24,30 @@ fn classified_errors_stay_at_byte_zero_after_tinybus_failure_wrapping() {);}+/// The depth the previous single-peel-plus-fallback form could not reach.+///+/// That form peeled one `Error.<Kind>: ` layer and had one `Error.Failed: `+/// fallback, so it topped out at **two** wire layers. This case carries three,+/// which the old form passed through unnormalised — reaching the frontend as an+/// unclassified outage ("the provider is down") instead of the classified+/// reason ("reconnect your account"). Nesting depth belongs to the transport,+/// not to a hardcoded guess here, so the peel now loops.+///+/// Three layers, not two, is deliberate: at two the old fallback still fired,+/// so a two-layer case passes against the pre-change code and proves nothing.+#[test]+fn classification_survives_however_many_wire_layers_tinybus_adds() {+ assert_eq!(+ super::normalize_error(+ methods::EXECUTE,+ "Execute: ai.tinyhumans.tinybus.Error.A: ai.tinyhumans.tinybus.Error.B: \+ ai.tinyhumans.tinybus.Error.Failed: [composio:error:rate_limited] Please retry later"+ .to_string()+ ),+ "[composio:error:rate_limited] Please retry later"+ );+}+#[test]fn unclassified_errors_keep_the_member_context() {assert_eq!(