jackwener/OpenCLI · error · Error
Not logged in — open jimeng.jianying.com in Chrome and sign
Error message
Not logged in — open jimeng.jianying.com in Chrome and sign in first
What it means
new.js creates a Jimeng workspace via an in-page fetch with credentials:'include'. If the API responds with ret '1014' (Jimeng's not-logged-in code), the script throws a plain Error instructing the user to open jimeng.jianying.com in Chrome and sign in first. It guards against creating a workspace without a valid session.
Source
Thrown at clis/jimeng/new.js:22
name: 'new',
access: 'write',
description: '即梦AI 新建会话(workspace)',
domain: 'jimeng.jianying.com',
strategy: Strategy.COOKIE,
browser: true,
columns: ['workspace_id', 'workspace_url'],
pipeline: [
{ navigate: 'https://jimeng.jianying.com/ai-tool/generate?type=image&workspace=0' },
{ evaluate: `(async () => {
const resp = await fetch('/mweb/v1/workspace/create?aid=513695', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
}).then(r => r.json());
if (resp.ret === '1014' || resp.ret === 1014) {
throw new Error('Not logged in — open jimeng.jianying.com in Chrome and sign in first');
}
if (resp.ret !== '0' && resp.ret !== 0) {
throw new Error('workspace/create failed: ret=' + resp.ret + ' errmsg=' + (resp.errmsg || ''));
}
const wsId = resp.data?.workspace_id;
if (!wsId) {
throw new Error('workspace/create returned no workspace_id: ' + JSON.stringify(resp).substring(0, 200));
}
return [{
workspace_id: String(wsId),
workspace_url: 'https://jimeng.jianying.com/ai-tool/generate?type=image&workspace=' + wsId,
}];
})()
` },
{ map: {
workspace_id: '${{ item.workspace_id }}',View on GitHub (pinned to 49907e53dc)
Solutions
- Open https://jimeng.jianying.com/ in the attached Chrome and sign in, then rerun the command
- Run the site's auth/login command first so the session is established before calling new
- Verify the correct Chrome profile is attached (the one with Jimeng cookies)
- Check cookies are not expired; re-login to refresh them
- If logged in but still 1014, confirm the create API and ret codes are unchanged and cookies are being sent (credentials:'include')
Example fix
// before
const resp = await fetch(url, { method: 'POST', credentials: 'include', ... });
// after
const resp = await fetch(url, { method: 'POST', credentials: 'include', ... });
if (resp.ret === '1014' || resp.ret === 1014) {
throw new AuthRequiredError('jimeng.jianying.com', 'Not logged in — open jimeng.jianying.com in Chrome and sign in first');
} Defensive patterns
Strategy: validation
Validate before calling
const probe = await page.evaluate(WHOAMI_PROBE);
if (!probe?.ok) throw new Error('Sign in to jimeng.jianying.com before creating a workspace'); Type guard
function isNotLoggedInRet(ret) {
return ret === '1014' || ret === 1014;
} Try / catch
try {
await createWorkspace();
} catch (err) {
if (/Not logged in/.test(err.message)) {
console.error('Open jimeng.jianying.com in the attached Chrome, sign in, then rerun.');
process.exitCode = 2; // distinct exit code for auth-required
} else throw err;
} Prevention
- Run an auth/verify check before workspace-creating commands
- Keep the attached Chrome profile logged in to Jimeng
- Handle both string and number ret codes ('1014'/1014)
- Re-login on session expiry rather than retrying blindly
When it happens
Trigger: Running the jimeng new command when the attached Chrome profile has no valid Jimeng session: the workspace/create API returns ret 1014 (string or number), triggering this error before any workspace id is obtained.
Common situations: User forgot to log into Jimeng in the controlled browser; cookies expired or cleared; using the wrong Chrome profile; Jimeng session invalidated server-side; running headless/automation profile without login.
Related errors
- ${probe.detail}
- 请先在共享 Chrome 完成 1688 登录/验证,再重试(${action})
- Bilibili ${label} API requires login or permission: ${messag
- bilibili.com
- ${probe.detail}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/0e5d7abaf04067b2.
Report an issue: GitHub.