BigPizzaV3/CodexPlusPlus · warning · Error

当前对话尚未读取完成,请稍后重试

Error message

当前对话尚未读取完成,请稍后重试

What it means

The organize flow waits for the conversation data sync to settle (sync(true) plus the pending loop). If afterwards data is empty, belongs to a different thread (data.threadId!==id), or the active conversation changed (currentId()!==id), the snapshot is not trustworthy and this error is thrown so no stale/partial organize runs.

Solutions

  1. Retry organize after the conversation has fully loaded
  2. Stay on the same conversation until organize starts
  3. Check the native read/pagination status if messages are very large (nativeReadTasks)
  4. Reload the page if data appears stuck empty

Example fix

// before
while(pending===id){/* wait */}
runOrganize(data)
// after
while(pending===id){await sleep(250)}
if(!data?.messages.length||data.threadId!==id) return retryLater();
Defensive patterns

Strategy: retry

Validate before calling

if(!data?.messages.length || data.threadId!==id || currentId()!==id){ await sync(true); await sleep(500); }

Type guard

function snapshotReady(data,id){return !!data?.messages?.length && data.threadId===id && currentId()===id;}

Try / catch

try{ await organizeLong(...) }catch(e){ if(e.message.includes('尚未读取完成')){ await sleep(1000); retryOrganize(); } }

Prevention

When it happens

Trigger: After sync and the 250ms pending-poll loop: data.messages empty, data.threadId !== target id, or currentId() !== id (user switched conversations mid-run).

Common situations: User navigated to another conversation while organize was starting; conversation still loading/very large so sync hadn't produced messages; thread switched quickly right after clicking organize.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/06ab01f21c5ff565. Report an issue: GitHub.

Appendix: source

Thrown at tools/conversation-canvas/public/canvas.user.js:1038

    if(active===id&&!organizing){
      $('organize').textContent=record?.job?'继续整理':record?.published?.done?'增量整理':'整理脉络';
      if(!data&&record?.job)organizationStatus(`已恢复整理进度 · 已保存 ${record.job.state.batchCount} 批,点击「继续整理」接续${record.job.kind==='rebuild'?';原任务树保留至重新整理完成':''}`);
    }
    if(record?.published){annotationCache.set(id,record.published);return;}
    try{const legacy=JSON.parse(localStorage.getItem(`conversation-canvas:organized:${id}`));if(legacy?.threadId===id&&Array.isArray(legacy.nodes))annotationCache.set(id,legacy);}catch{}
  }
  function organizationStatus(text){$('organization-status').hidden=!text;$('organization-status').textContent=text;}
  async function organize(){
    if(organizing||testingApi)return;
    const id=currentId();if(!id)return;
    organizing=id;organizationAbort=new AbortController();const signal=organizationAbort.signal;
    $('organize').disabled=true;settingsButton.disabled=true;$('pause-organize').hidden=false;
    try{
      await settingsReady;const config=apiConfig(organizerConfig);
      organizationStatus('正在读取待整理资料…');
      await sync(true);
      while(pending===id){signal.throwIfAborted();await new Promise(resolve=>setTimeout(resolve,250));}
      if(!data?.messages.length||data.threadId!==id||currentId()!==id)throw Error('当前对话尚未读取完成,请稍后重试');
      await hydrateAnnotations(id);
      const snapshot=data,old=storedAnnotations(id);
      const record=recordCache.get(id)||{published:old.nodes.length?old:null};
      const applyGraph=result=>{annotationCache.set(id,result);if(!disposed&&active===id){data={...data,...buildGraph(data.messages,result)};selected=null;$('details').hidden=true;render();status(`已同步${nativeReadTasks.has(id)?'(原生分页)':''} · ${result.nodes.length} 个任务节点`);}};
      const showProgress=text=>{if(active!==id)return;const job=recordCache.get(id)?.job;const repair=job?.pending?.repair;organizationStatus(`${job?.kind==='rebuild'?'重整中,当前展示上次结果 · ':''}${repair?`补正 ${repair.attempt}/2 · `:''}${text}`);};
      const saved=await organizeLong({messages:snapshot.messages,record,signal,compact:config.channel==='external',
        save:async document=>{await canvasStore(`tree:${id}`,document);recordCache.set(id,document);},
        progress:showProgress,onGraph:applyGraph,
        run:(prompt,requestId,session,onSession)=>config.channel==='external'
          ?externalOrganizer.run(config,prompt,requestId,session,onSession,signal,text=>showProgress(`第 ${(recordCache.get(id)?.job?.state?.batchCount||0)+1} 批 · ${text}`))
          :nativeSideChat(id,prompt,text=>showProgress(`第 ${(recordCache.get(id)?.job?.state?.batchCount||0)+1} 批 · ${text}`),signal,{session,onSession,requestId})});
      if(!disposed&&active===id)organizationStatus(`整理完成 · ${saved.published.nodes.length} 个任务节点,进度已保存;新增消息可增量整理`);
    }catch(error){if(!disposed&&active===id)organizationStatus(error.name==='AbortError'?'已暂停,已完成批次保留。后台模型可能仍在运行,点击继续可接收结果。':`整理暂未完成:${error.message}。已完成批次保留,点击继续重试。`);}
    finally{organizing=null;if(!disposed){$('organize').disabled=false;settingsButton.disabled=false;$('organize').textContent=recordCache.get(active)?.job?'继续整理':'增量整理';$('pause-organize').hidden=true;}}
  }
  function currentId(){
    const route=(location.href.match(uuid)||[])[0];if(route)return route;
    const rows=[...document.querySelectorAll('[data-app-action-sidebar-thread-id]')].filter(row=>['page','true'].includes(row.getAttribute('aria-current'))||row.querySelector('[aria-current="page"],[aria-current="true"]'));

View on GitHub (pinned to b1ed92e5e4)