jackwener/OpenCLI · error · CommandExecutionError
ChatGPT did not open the requested project ${id}. Current UR
Error message
ChatGPT did not open the requested project ${id}. Current URL: ${state.url || '(unknown)'} What it means
Thrown after loading a ChatGPT project when the page state check fails: the session is logged in (no AuthRequiredError), but projectIdFromUrl(state.url) does not match the requested project id, meaning ChatGPT did not actually open that project.
Source
Thrown at clis/chatgpt/utils.js:2945
];
/**
* Navigate to a ChatGPT project page.
*/
export async function navigateToProject(page, projectId) {
const id = parseChatGPTProjectId(projectId);
await page.goto(`${CHATGPT_URL}/g/g-p-${id}`, { settleMs: 2000 });
try {
await page.wait({ selector: COMPOSER_WAIT_SELECTOR, timeout: 10 });
} catch {
// Composer may not mount if project requires login; downstream ensureChatGPTLogin handles it.
}
const state = await getPageState(page);
if (projectIdFromUrl(state.url) === id) return id;
if (state.hasLoginGate || !state.isLoggedIn) {
throw new AuthRequiredError(CHATGPT_DOMAIN, 'ChatGPT project requires a logged-in ChatGPT session.');
}
throw new CommandExecutionError(
`ChatGPT did not open the requested project ${id}.`,
`Current URL: ${state.url || '(unknown)'}`,
);
}
/**
* Open the Project knowledge files dialog by clicking the "Add files" button
* in the project header area (NOT the chat composer's plus button).
* Returns true if the dialog appeared.
*/
export async function openProjectKnowledgeDialog(page) {
const rawOpenResult = unwrapEvaluateResult(await page.evaluate(`
(() => {
const labels = ${JSON.stringify(PROJECT_ADD_FILES_LABELS)};
const isVisible = (el) => {
if (!(el instanceof HTMLElement)) return false;
const style = window.getComputedStyle(el);
if (style.display === 'none' || style.visibility === 'hidden') return false;View on GitHub (pinned to 49907e53dc)
Solutions
- Verify the project id (re-list projects) — it may be deleted or mistyped
- Check you have access/permission to the project in the logged-in account
- Retry once after a short delay to let the SPA finish updating the URL, or wait for the project URL explicitly before verifying
- Open the project URL manually in the same profile to see where ChatGPT redirects
Example fix
// before
await page.goto(projectUrl);
const id = await ensureChatGPTProjectOpen(page, projectId);
// after
await page.goto(projectUrl);
await page.waitForURL(/project/, { timeout: 15000 });
const id = await ensureChatGPTProjectOpen(page, projectId); Defensive patterns
Strategy: validation
Validate before calling
const state = await getPageState(page);
if (projectIdFromUrl(state.url) !== projectId) {
throw new Error(`project ${projectId} not open; current URL: ${state.url}`);
} Type guard
function projectIsOpen(state, id) { return !!state?.url && projectIdFromUrl(state.url) === id; } Try / catch
try {
await openChatGPTProject(page, projectId);
} catch (e) {
if (String(e.message).startsWith('ChatGPT did not open the requested project')) {
// re-list projects to confirm the id exists, check permissions, then retry once
} else throw e;
} Prevention
- Validate project ids against a fresh project list before opening
- Confirm account access/permission to the project
- Wait for the SPA to settle (waitForURL on the project path) before verifying the id
When it happens
Trigger: getPageState returns a URL whose parsed project id differs from the requested id (or is not a project URL at all) after navigation/verification attempts — redirect to home, project deleted/unavailable, or the SPA landed on a fallback view.
Common situations: Project id typo or stale id from a deleted/renamed project; no access to a shared project (permission revoked); ChatGPT redirecting to home because the project 404s; SPA race where the URL hasn't updated yet.
Related errors
- ChatGPT deep-research-result did not stay on requested conve
- ChatGPT deep-research-result conversation mismatch: expected
- ChatGPT navigated away from the target conversation (${optio
- xiaohongshu collection landed on unexpected page: ${toCleanS
- 1688 ${action} navigation lost the current browser target
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e090592c7e03fb4d.
Report an issue: GitHub.