@devries-cameron20 / composio-1 / commits / 62157215d
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(cli): degrade gracefully when list response has unknown status

`Schema.decodeUnknown(ConnectedAccountListResponse)` was yielded without a `catchTag`, so any new server-side connection status (REVOKED was added in Apollo PR #9550, S2S_OAUTH2 revocation is queued next) would brick `composio dev connected-accounts list` for the entire user base — even users only filtering on `--status ACTIVE`. Catch `ParseError`, log a warning pointing at `composio upgrade`, and fall back to the raw server response so the table still renders. Addresses PR #3344 review comment P1#4.

jkomyno committed May 7, 2026 at 10:19 UTC 62157215d7cb0bb5caf4ffc7b4c09edc4d416c3c
1 file changed +20 -1
ts/packages/cli/src/commands/connected-accounts/commands/connected-accounts.list.cmd.ts
+20 -1
@@ -94,7 +94,26 @@ export const connectedAccountsCmd$List = Command.make(
94 })
95 )
96 );
97 - const result = yield* Schema.decodeUnknown(ConnectedAccountListResponse)(rawResult);
97 + // The Composio server enum for connection statuses evolves on Apollo's
98 + // cadence (REVOKED was added in PR #9550; S2S_OAUTH2 revocation is queued
99 + // next). A closed `Schema.Literal(...)` in `ConnectedAccountItem` would
100 + // reject any future status and brick `composio dev connected-accounts list`
101 + // for every user — even those filtering on `--status ACTIVE`. Catch the
102 + // ParseError, warn, and degrade to the raw response so the table still
103 + // renders.
104 + const result = yield* Schema.decodeUnknown(ConnectedAccountListResponse)(rawResult).pipe(
105 + Effect.catchTag('ParseError', error =>
106 + Effect.gen(function* () {
107 + yield* ui.log.warn(
108 + `Server returned a connection field this CLI does not recognize ` +
109 + `(likely a newly-added status). Run "composio upgrade" to pick up ` +
110 + `the latest schema. Continuing with raw response.\n\n` +
111 + `Decode error: ${error.message}`
112 + );
113 + return rawResult as ConnectedAccountListResponse;
114 + })
115 + )
116 + );
117
118 if (result.items.length === 0) {
119 let hint: string;