Skip to content

Use session titles for project descriptions#60

Merged
pablopunk merged 1 commit into
mainfrom
project-description-session-title
May 14, 2026
Merged

Use session titles for project descriptions#60
pablopunk merged 1 commit into
mainfrom
project-description-session-title

Conversation

@pablopunk
Copy link
Copy Markdown
Owner

@pablopunk pablopunk commented May 14, 2026

Summary

  • Add a project description field initialized from the initial prompt
  • Render project descriptions on cards while keeping the prompt as fallback
  • Sync descriptions asynchronously from OpenCode session titles via queue and SSE events

Verification

  • pnpm build

Summary by CodeRabbit

  • New Features

    • Projects now support descriptions that are automatically synchronized based on session activity.
    • Project descriptions are displayed on project cards and take precedence over default prompts when available.
  • UI/UX Improvements

    • Updated project creation label from "Creating project..." to "New project" for improved clarity.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
doce-dev-www Ready Ready Preview, Comment May 14, 2026 5:01pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Walkthrough

This PR adds automatic project description synchronization from Opencode session titles. A new description column is added to the projects table and backfilled with existing prompt values. Upstream session.updated events are normalized and trigger description sync jobs that fetch session titles, normalize them (filtering defaults and ignored patterns), and persist updates via a retry-based queue handler with timeout logic. Project creation now initializes descriptions from prompts, and prompt completion enqueues sync jobs. The UI prefers stored descriptions over prompts in display.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Use session titles for project descriptions' accurately describes the main objective of the changeset, which adds functionality to synchronize and use session titles as project descriptions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot temporarily deployed to pr-60 May 14, 2026 17:01 Destroyed
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/server/queue/handlers/opencodeSendUserPrompt.ts`:
- Around line 451-460: The current flow persists markInitialPromptSent before
calling enqueueProjectDescriptionSync, so a transient failure in enqueue will
leave project.initialPromptSent true and future retries will skip enqueuing; to
fix, ensure enqueueProjectDescriptionSync succeeds before persisting
markInitialPromptSent (or persist markInitialPromptSent only after enqueue
resolves). Concretely, move the Effect.tryPromise block that calls
enqueueProjectDescriptionSync({ projectId: project.id }) to run prior to the
call that sets project.initialPromptSent (or change the transaction to perform
enqueue first and only then call markInitialPromptSent), and propagate any
enqueue error so markInitialPromptSent is not saved on enqueue failure; use the
existing symbols enqueueProjectDescriptionSync and markInitialPromptSent to
locate and reorder/adjust the logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4884303e-566a-437f-a78c-6b78f83c367f

📥 Commits

Reviewing files that changed from the base of the PR and between a702289 and 810ec7c.

📒 Files selected for processing (18)
  • drizzle/0006_keen_domino.sql
  • drizzle/meta/0006_snapshot.json
  • drizzle/meta/_journal.json
  • src/components/projects/ProjectCard.tsx
  • src/components/projects/ProjectsList.tsx
  • src/pages/api/projects/[id]/opencode/event.ts
  • src/server/db/schema.ts
  • src/server/effect/handlers.ts
  • src/server/effect/schemas.ts
  • src/server/opencode/normalize.ts
  • src/server/projects/projects.db.ts
  • src/server/projects/sessionDescription.ts
  • src/server/queue/enqueue.ts
  • src/server/queue/handlers/opencodeSendUserPrompt.ts
  • src/server/queue/handlers/projectCreate.ts
  • src/server/queue/handlers/projectDescriptionSync.ts
  • src/server/queue/types.ts
  • src/stores/useChatStore.ts

Comment on lines +451 to +460
yield* Effect.tryPromise({
try: () => enqueueProjectDescriptionSync({ projectId: project.id }),
catch: (error) =>
new ProjectError({
projectId: project.id,
operation: "enqueueProjectDescriptionSync",
message: error instanceof Error ? error.message : String(error),
cause: error,
}),
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Retry path can permanently skip description sync after transient enqueue failure.

Because markInitialPromptSent is already persisted before this block, a failure here causes retry runs to exit early at Line 86 (project.initialPromptSent), so project.descriptionSync may never be enqueued.

💡 Suggested fix
@@
-		if (project.initialPromptSent) {
-			logger.info(
-				{ projectId: project.id },
-				"User prompt already sent, skipping",
-			);
-			return;
-		}
+		if (project.initialPromptSent) {
+			// Retry-safe: ensure follow-up sync still gets a chance after transient failures.
+			yield* Effect.tryPromise({
+				try: () => enqueueProjectDescriptionSync({ projectId: project.id }),
+				catch: (error) =>
+					new ProjectError({
+						projectId: project.id,
+						operation: "enqueueProjectDescriptionSync",
+						message: error instanceof Error ? error.message : String(error),
+						cause: error,
+					}),
+			});
+			logger.info(
+				{ projectId: project.id },
+				"User prompt already sent; ensured description sync is enqueued",
+			);
+			return;
+		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/server/queue/handlers/opencodeSendUserPrompt.ts` around lines 451 - 460,
The current flow persists markInitialPromptSent before calling
enqueueProjectDescriptionSync, so a transient failure in enqueue will leave
project.initialPromptSent true and future retries will skip enqueuing; to fix,
ensure enqueueProjectDescriptionSync succeeds before persisting
markInitialPromptSent (or persist markInitialPromptSent only after enqueue
resolves). Concretely, move the Effect.tryPromise block that calls
enqueueProjectDescriptionSync({ projectId: project.id }) to run prior to the
call that sets project.initialPromptSent (or change the transaction to perform
enqueue first and only then call markInitialPromptSent), and propagate any
enqueue error so markInitialPromptSent is not saved on enqueue failure; use the
existing symbols enqueueProjectDescriptionSync and markInitialPromptSent to
locate and reorder/adjust the logic.

@github-actions github-actions Bot had a problem deploying to pr- May 14, 2026 17:06 Failure
@pablopunk pablopunk merged commit ac3dedb into main May 14, 2026
11 of 12 checks passed
@pablopunk pablopunk deleted the project-description-session-title branch May 14, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant