Skip to content

Conversation

@rossmanko
Copy link
Contributor

@rossmanko rossmanko commented Dec 1, 2025

Summary by CodeRabbit

  • Chores
    • Updated internal dependencies to latest versions for improved stability and security.
    • Reorganized system prompt generation architecture for enhanced maintainability.
    • Updated payment processing integration to the latest version.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
hackerai Ready Ready Preview Comment Dec 1, 2025 7:49pm

@coderabbitai
Copy link

coderabbitai bot commented Dec 1, 2025

Walkthrough

The PR updates the Stripe API version to "2025-11-17.clover", restructures the system prompt generation from static multi-section concatenation to mode-driven dynamic assembly with new agent/ask mode sections, and bumps multiple dependency versions including a major Stripe version bump from 19 to 20.

Changes

Cohort / File(s) Summary
Stripe API Configuration
app/api/stripe.ts
Updated Stripe client initialization API version from "2025-10-29.clover" to "2025-11-17.clover".
System Prompt Architecture
lib/system-prompt.ts
Refactored prompt generation from static concatenated sections to mode-driven dynamic assembly. Removed discrete sections (communication, tool_calling, parallel tool calls, context understanding, general guidelines, etc.) and introduced getAgentModeSection, getAskModeSection, and restructured sandbox environment handling. System prompt now conditionally assembles sections based on mode ("ask" vs. others) with dynamic sandboxContext integration.
Dependency Management
package.json
Bumped versions: @ai-sdk/openai (^2.0.74→^2.0.75), @ai-sdk/react (^2.0.104→^2.0.105), ai (^5.0.104→^5.0.105), stripe (^19.3.1→^20.0.0 major), e2b (^2.8.1→^2.8.2), shiki (^3.17.0→^3.17.1), streamdown (^1.6.8→^1.6.9), motion (^12.23.24→^12.23.25), next (16.0.5→16.0.6), eslint-config-next (16.0.5→16.0.6), prettier (^3.7.1→^3.7.3).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • lib/system-prompt.ts: Significant architectural refactoring with removal of multiple sections and introduction of mode-based conditional assembly; requires careful tracing of old vs. new prompt sections and verification that all functionality is preserved.
  • stripe major version bump: The upgrade from v19 to v20 in package.json should be validated for breaking changes and API compatibility in app/api/stripe.ts usage.
  • System prompt method signature: Confirm that the systemPrompt function signature changes align with all call sites.

Possibly related PRs

Poem

🐰 A version dance, both old and new,
Stripe paths shimmer, fresh and true,
Prompts reshape in modes so bright,
Agent asks dance through the night,
Dependencies bloom, the garden grows—
Off we hop where progress flows!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Daily branch 2025 12 01' is generic and does not describe the actual changes. It appears to be a date-based branch name rather than a meaningful summary of the pull request contents (Stripe API version update, system prompt restructuring, and dependency updates). Provide a descriptive title that summarizes the main changes, such as 'Update Stripe API version, refactor system prompts, and bump dependencies' or focus on the most significant change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch daily-branch-2025-12-01

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

Copy link

@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: 0

🧹 Nitpick comments (2)
lib/system-prompt.ts (2)

32-62: Default sandbox description: ensure it stays in sync with the real environment

The default <sandbox_environment> section is clear and detailed. The only concern is that it hard‑codes OS, language versions, and tool list. If the underlying sandbox changes (e.g., Node/Python versions or installed tools), this prompt will become misleading.

Consider centralizing this environment description (or generating it from config) so it’s easier to keep in sync with the actual sandbox, or at least adding a short comment pointing to the source of truth you check when updating these details.


64-163: Agent-mode section structure looks solid; minor extensibility note

The new getAgentModeSection cleanly groups communication, tool‑calling, context‑gathering, code‑change, summary, and sandbox instructions and correctly parameterizes:

  • agentSpecificNote and codeChangesContent based on mode
  • Sandbox usage via ${sandboxContext || getDefaultSandboxEnvironmentSection()}

Logically this is sound given ChatMode = "agent" | "ask". One thing to keep in mind:

If you ever introduce additional ChatMode variants, you may want to either:

  • Narrow mode here to "agent" (so other modes don’t accidentally reuse this section), or
  • Explicitly handle each mode with a switch to avoid surprising prompt content for future modes.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b96838 and c7533f0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • app/api/stripe.ts (1 hunks)
  • lib/system-prompt.ts (4 hunks)
  • package.json (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
package.json

📄 CodeRabbit inference engine (.cursor/rules/convex_rules.mdc)

Add @types/node to package.json when using any Node.js built-in modules in Convex functions

Files:

  • package.json
🧠 Learnings (2)
📚 Learning: 2025-11-24T20:59:07.600Z
Learnt from: CR
Repo: hackerai-tech/hackerai PR: 0
File: .cursor/rules/convex_rules.mdc:0-0
Timestamp: 2025-11-24T20:59:07.600Z
Learning: Applies to package.json : Add `types/node` to `package.json` when using any Node.js built-in modules in Convex functions

Applied to files:

  • package.json
📚 Learning: 2025-11-12T15:23:01.117Z
Learnt from: fkesheh
Repo: hackerai-tech/hackerai PR: 92
File: lib/ai/tools/utils/sandbox-file-uploader.ts:10-10
Timestamp: 2025-11-12T15:23:01.117Z
Learning: In the hackerai codebase, NEXT_PUBLIC_USE_S3_STORAGE is intentionally used in both client and server code (including server-only files like lib/ai/tools/utils/sandbox-file-uploader.ts) to ensure the frontend and backend stay in sync regarding which storage backend (S3 vs Convex) is being used. This consistency is important for file upload flows that span both environments.

Applied to files:

  • package.json
🧬 Code graph analysis (1)
lib/system-prompt.ts (2)
types/chat.ts (1)
  • ChatMode (6-6)
lib/ai/providers.ts (2)
  • ModelName (24-24)
  • getModelCutoffDate (37-39)
🔇 Additional comments (4)
package.json (1)

42-43: Dependency bumps look reasonable; Stripe v20 is the main risk surface

The version bumps here are mostly minor/patch, with the notable exception of:

  • "stripe": "^20.0.0" (major)
  • "next": "16.0.6" and "eslint-config-next": "16.0.6" (framework/tooling updates)

Nothing stands out as obviously unsafe, but please:

  • Review Stripe v20 release notes for breaking changes that might affect your usage patterns (webhooks, payment flows, idempotency, etc.).
  • Run your usual CI (lint/tests/build) against this branch before merging to catch any subtle type/runtime regressions from these upgrades.

It’s also good to see "@types/node": "^24" already present in devDependencies, which aligns with the guideline about using Node built‑ins in Convex functions. Based on learnings, this is correctly configured.

Consider checking upstream changelogs for stripe@20 and next@16.0.6 to confirm there are no migration steps you’re missing.

Also applies to: 71-71, 78-78, 86-87, 100-103, 128-128, 133-133

lib/system-prompt.ts (2)

165-221: Ask-mode section: confirm getModelCutoffDate covers all ModelName values

The ask‑mode block cleanly covers product‑question handling, tone/formatting, and knowledge‑cutoff behavior. The only potential edge case is:

  • const knowledgeCutOffDate = getModelCutoffDate(modelName); will surface as "undefined" in the rendered prompt if modelName doesn’t have an entry in your cutoff map.

Either ensure getModelCutoffDate is total over all ModelName values, or defensively fall back to a default cutoff date if it returns a falsy value. If you’d like, I can sketch a small guard to avoid leaking "undefined" into the system prompt.


285-289: Mode-based section assembly: verify that ask-mode is intentionally sandbox/tool-light

The new assembly logic pushes:

  • getAskModeSection(modelName) when mode === "ask",
  • getAgentModeSection(mode, sandboxContext) otherwise.

This means only agent mode gets the <tool_calling> and <sandbox_environment> sections; ask mode gets tone/formatting + knowledge‑cutoff but no explicit sandbox or tool‑usage guidance.

Please confirm this is intentional. If ask‑mode conversations are still allowed to use tools or rely on sandbox context, you may want to share (or partially share) the tool/sandbox instructions between both modes to keep behavior consistent.

app/api/stripe.ts (1)

4-4: Verify Stripe account and webhook compatibility with the new API version

The apiVersion "2025-11-17.clover" is a valid Stripe Clover-series release. Ensure your Stripe account and webhook endpoints are configured to accept this API version to avoid unexpected behavior.

@rossmanko rossmanko merged commit 2ba17cc into main Dec 1, 2025
4 checks passed
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.

2 participants