Skip to content

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

fix(test): assert the shipped /skills redirect, and make the TinyBus peel reachable\n\nTwo unrelated-looking items with one shape: assertions and error handling that\ncould not do the job they were written for.\n\n`786d7ba76` replaced `<Navigate to="/connections" replace />` with\n`<ForwardSearch to="/connections" />`, which copies `search` and `hash` onto the\ntarget so a `?tab=` deep link survives the redirect. Two specs still asserted the\nold behaviour -- that the query is DROPPED -- one of them committed 94 minutes\nafter the fix landed:\n\n- route-redirect-history.spec.ts:114 not.toContain('tab=messaging')\n- connections-tab-deeplinks.spec.ts:176 not.toContain('tab=channels')\n + expectSelectedTab('welcome')\n\nIn that form they passed only while the bug was present, so the fix -- not a\nregression -- is what would have turned them red. Both now assert the shipped\nbehaviour. The deeplinks case also asserts the SELECTED tab (`channels` is a\ncanonical value in Skills.tsx), because a forwarded query that failed to resolve\nwould still leave the right hash while showing the wrong panel. Three stale\ncomments that still described the redirect as broken are corrected with them.\n\n`module_client::normalize_error` peeled one `ai.tinyhumans.tinybus.Error.<Kind>:`\nlayer, then had a second `strip_prefix` guarding `Error.Failed: ` specifically.\nThe peel above it already consumed that prefix, so the fallback was reachable\nonly by a *doubly* wire-wrapped error -- not the shape its own comment described.\nConfirmed by removing it: `classified_errors_stay_at_byte_zero_after_tinybus_\nfailure_wrapping`, which asserts exactly that documented shape, still passes.\n\nDeleting it outright would have regressed the two-layer case it did catch, so\nthe peel now loops instead. Output is unchanged for every shape the old form\nhandled; a three-layer wrap, which the old form passed through unnormalised --\nreaching the frontend as an unclassified outage rather than the classified\nreason -- now normalises too. That depth is pinned by a new test.\n\nPlaywright, with /skills reverted to a bare <Navigate> and dist-web rebuilt:\nboth specs FAIL naming their own assertions (toContain('tab=channels') and\ntoContain('tab=messaging'), each receiving "#/connections"); restored, both pass.\n\nRust, with the loop reverted to single-peel-plus-fallback: the new depth test\nFAILS naming its assertion, the other seven pass; restored, all eight pass.\nThe first version of that test used two wire layers and passed against the\nreverted code -- vacuous, because the old fallback still fired at that depth.\nIt carries three layers for that reason.\n

M3gA-Mind20ba8c5fa58b
diff --git a/app/test/playwright/specs/route-redirect-history.spec.ts b/app/test/playwright/specs/route-redirect-history.spec.ts
index 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 na
await 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.rs
index 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.rs
index 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!(