Use session titles for project descriptions#60
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR adds automatic project description synchronization from Opencode session titles. A new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (18)
drizzle/0006_keen_domino.sqldrizzle/meta/0006_snapshot.jsondrizzle/meta/_journal.jsonsrc/components/projects/ProjectCard.tsxsrc/components/projects/ProjectsList.tsxsrc/pages/api/projects/[id]/opencode/event.tssrc/server/db/schema.tssrc/server/effect/handlers.tssrc/server/effect/schemas.tssrc/server/opencode/normalize.tssrc/server/projects/projects.db.tssrc/server/projects/sessionDescription.tssrc/server/queue/enqueue.tssrc/server/queue/handlers/opencodeSendUserPrompt.tssrc/server/queue/handlers/projectCreate.tssrc/server/queue/handlers/projectDescriptionSync.tssrc/server/queue/types.tssrc/stores/useChatStore.ts
| 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, | ||
| }), | ||
| }); |
There was a problem hiding this comment.
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.
Summary
Verification
Summary by CodeRabbit
New Features
UI/UX Improvements