Skip to content

Conversation

@sestinj
Copy link
Contributor

@sestinj sestinj commented Sep 10, 2025

Description

can now use {{{ filepath }}} in promptTemplates for apply


Summary by cubic

Enable {{{ filepath }}} in apply prompt templates so prompts can adapt to the current file. We pass the last path segment from fileUri as "filepath" to renderPromptTemplate alongside original_code and new_code.

@sestinj sestinj requested a review from a team as a code owner September 10, 2025 05:00
@sestinj sestinj requested review from tingwai and removed request for a team September 10, 2025 05:00
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 10, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.


let overridePrompt: ChatMessage[] | undefined;
if (llm.promptTemplates?.apply) {
const filepath = getLastNPathParts(fileUri, 1);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 10, 2025

Choose a reason for hiding this comment

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

Using getLastNPathParts on a URI can yield incorrect results for non-file schemes and ignores URI encoding; use the URI-aware basename helper instead.

Prompt for AI agents
Address the following comment on extensions/vscode/src/diff/vertical/manager.ts at line 436:

<comment>Using getLastNPathParts on a URI can yield incorrect results for non-file schemes and ignores URI encoding; use the URI-aware basename helper instead.</comment>

<file context>
@@ -432,9 +433,11 @@ export class VerticalDiffManager {
 
     let overridePrompt: ChatMessage[] | undefined;
     if (llm.promptTemplates?.apply) {
+      const filepath = getLastNPathParts(fileUri, 1);
       const rendered = llm.renderPromptTemplate(llm.promptTemplates.apply, [], {
         original_code: rangeContent,
</file context>
Fix with Cubic

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Sep 10, 2025
@sestinj sestinj merged commit 0775433 into main Sep 10, 2025
40 of 42 checks passed
@sestinj sestinj deleted the nate/apply-updates branch September 10, 2025 09:07
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Sep 10, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 10, 2025
@github-actions github-actions bot added the tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys label Sep 10, 2025
@sestinj
Copy link
Contributor Author

sestinj commented Sep 11, 2025

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released size:L This PR changes 100-499 lines, ignoring generated files. tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants