coleam00/Archon · error

Failed to set up Gitea conversation - please try again

Error message

Failed to set up Gitea conversation - please try again

What it means

During webhook handling, after finding an existing conversation the adapter updates the conversation's codebase link. If that update fails with ConversationNotFoundError, the adapter rethrows it as this generic setup error because a conversation without its codebase link cannot process the message. The original conversation-not-found condition is logged as conversation_codebase_link_failed.

Source

Thrown at packages/adapters/src/community/forge/gitea/adapter.ts:849

      repoPath,
      isNew: isNewCodebase,
    } = await this.getOrCreateCodebaseForRepo(owner, repo);

    // 9b. Link conversation to codebase
    if (isNewConversation) {
      try {
        await db.updateConversation(existingConv.id, {
          codebase_id: codebase.id,
          cwd: repoPath,
        });
      } catch (updateError) {
        if (updateError instanceof ConversationNotFoundError) {
          getLog().error(
            { conversationId: existingConv.id, codebaseId: codebase.id },
            'conversation_codebase_link_failed'
          );
          // Re-throw as this is a critical setup step
          throw new Error('Failed to set up Gitea conversation - please try again');
        }
        throw updateError;
      }
    }

    // 10. Get default branch from repository info
    const defaultBranch = event.repository.default_branch;

    // 11. Ensure repo ready (clone if needed, sync if new conversation)
    await this.ensureRepoReady(owner, repo, defaultBranch, repoPath, isNewCodebase);

    // 12. Auto-load commands if new codebase
    if (isNewCodebase) {
      await this.autoDetectAndLoadCommands(repoPath, codebase.id);
    }

    // 13. Gather isolation hints for orchestrator
    const isolationHints: IsolationHints = {

View on GitHub (pinned to 0773b97458)

Solutions

  1. Retry the webhook/message — the message says 'please try again' and a fresh lookup will create a new conversation if needed.
  2. Check logs for conversation_codebase_link_failed to find the conversationId and who deleted it.
  3. Avoid running /reset or conversation cleanup concurrently with active webhook deliveries.
  4. If it reproduces, inspect the conversation store for retention/cleanup jobs racing with webhook handling.
Defensive patterns

Strategy: retry

Try / catch

try {
  await adapter.handleWebhook(update);
} catch (err) {
  if (err instanceof Error && err.message === 'Failed to set up Gitea conversation - please try again') {
    await sleep(500);
    return adapter.handleWebhook(update); // safe: next run re-resolves/creates the conversation
  }
  throw err;
}

Prevention

When it happens

Trigger: handleWebhook where the conversation record existing at lookup time is deleted (or its id becomes invalid) between the lookup and the codebase-link update — e.g. a concurrent /reset or conversation cleanup removed it mid-flight.

Common situations: Two webhook deliveries racing: one processes /reset deleting the conversation while the other tries to link the codebase; database row purged by a retention job during handling; stale conversation id cached by the forge side.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/1ffce5fb4c9c2b6f. Report an issue: GitHub.