jackwener/OpenCLI · error · Error

workspace/list failed: ret=${data.ret} errmsg=${data.errmsg

Error message

workspace/list failed: ret=${data.ret} errmsg=${data.errmsg || ''}

What it means

Thrown by the `jimeng workspaces` command when the workspace/list endpoint returns a non-zero `ret` other than the specific 1014 'not logged in' code. It echoes the raw `ret` and `errmsg` from Jimeng's {ret, errmsg, data} envelope, indicating the server rejected the list request for a reason other than plain authentication.

Source

Thrown at clis/jimeng/workspaces.js:25

    domain: 'jimeng.jianying.com',
    strategy: Strategy.COOKIE,
    browser: true,
    columns: ['workspace_id', 'name', 'is_pinned', 'updated_at'],
    pipeline: [
        { navigate: 'https://jimeng.jianying.com/ai-tool/generate?type=image&workspace=0' },
        { evaluate: `(async () => {
  const res = await fetch('/mweb/v1/workspace/list?aid=513695&web_version=7.5.0&da_version=3.3.12', {
    method: 'POST',
    credentials: 'include',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({})
  });
  const data = await res.json();
  if (data.ret === '1014' || data.ret === 1014) {
    throw new Error('Not logged in — open jimeng.jianying.com in Chrome and sign in first');
  }
  if (data.ret !== '0' && data.ret !== 0) {
    throw new Error('workspace/list failed: ret=' + data.ret + ' errmsg=' + (data.errmsg || ''));
  }
  return (data.data?.workspaces || []).map(ws => ({
    workspace_id: String(ws.workspace_id),
    name: ws.name || '',
    is_pinned: ws.is_pinned ? 'yes' : 'no',
    updated_at: ws.update_time ? new Date(ws.update_time).toLocaleString('zh-CN') : '',
  }));
})()
` },
        { map: {
                workspace_id: '${{ item.workspace_id }}',
                name: '${{ item.name }}',
                is_pinned: '${{ item.is_pinned }}',
                updated_at: '${{ item.updated_at }}',
            } },
    ],
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Read the `ret`/`errmsg` in the message and address the specific server-side cause it names.
  2. Slow down / retry after a pause if the code indicates frequency limits.
  3. Re-sign in to jimeng.jianying.com in Chrome — some session issues surface as codes other than 1014.
  4. Check jimeng.jianying.com availability in the browser; if the site itself errors, wait for the incident to resolve.
  5. Update the CLI if the endpoint contract changed.

Example fix

// Add retry for transient/frequency codes:
// before
if (data.ret !== '0' && data.ret !== 0) { throw new Error('workspace/list failed: ret=' + data.ret + ...); }
// after
if (data.ret === '1080' /* frequency limit */) { await sleep(2000); return listWorkspaces(); }
if (data.ret !== '0' && data.ret !== 0) { throw new Error('workspace/list failed: ret=' + data.ret + ...); }
Defensive patterns

Strategy: retry

Validate before calling

// Throttle your own polling:
if (Date.now() - lastListRun < 5000) throw new Error('list called too soon');

Type guard

function isOkEnvelope(data) {
  return data && (data.ret === '0' || data.ret === 0) && Array.isArray(data.data?.workspaces);
}

Try / catch

try {
  await run(['jimeng', 'workspaces']);
} catch (e) {
  const m = String(e.message).match(/workspace\/list failed: ret=(\S+)/);
  if (m && isFrequencyCode(m[1])) {
    await new Promise(r => setTimeout(r, 5000));
    return run(['jimeng', 'workspaces']); // bounded retry
  }
  throw e;
}

Prevention

When it happens

Trigger: fetch to the workspace/list endpoint (credentials: 'include') resolves with {ret: <non-zero, not 1014>}: e.g. rate limiting, permission/version errors, or API contract changes.

Common situations: Polling the list too frequently triggers frequency-limit ret codes; Jimeng changes the endpoint or adds required params; a semi-valid session passes some endpoints but fails others; region or service incident.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/3c3ac1989d660624. Report an issue: GitHub.