-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor file edit handling for improved modularity and functionality #759
Conversation
@@ -59,7 +59,7 @@ import { | |||
} from "../../core/src/util" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement for 'writeFileEdits' has been changed from "../../core/src/edits" to "../../core/src/fileedits". Please ensure that the new module 'fileedits' contains the 'writeFileEdits' function and it behaves as expected.
generated by pr-review-commit
import_change
@@ -624,12 +641,18 @@ export function createChatGenerationContext( | |||
messages, | |||
tools, | |||
schemas, | |||
fileOutputs, | |||
outputProcessors, | |||
fileMerges, | |||
completer, | |||
chatParticipants, | |||
genOptions | |||
) | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function 'defOutputProcessor' has been removed from the 'RunPromptContextNode' interface. This might break existing functionality if there are any references to this function in the codebase.
generated by pr-review-commit
missing_function
The changes include:
The changes seem to be well-implemented overall. The separation of file editing logic into a separate module ( Although the changes seem extensive, they are structured and systematic, which is positive. Thus, I would suggest: LGTM 🚀
|
@@ -401,16 +402,19 @@ function assistantText( | |||
return text | |||
} | |||
|
|||
function structurifyChatSession( | |||
async function structurifyChatSession( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function 'structurifyChatSession' has been changed to an async function but no await expressions are present in the function body. Ensure that the function is using async operations correctly.
generated by pr-review-commit
async_function
@@ -458,7 +462,7 @@ function structurifyChatSession( | |||
if (fences?.length) | |||
frames.push(...validateFencesWithSchema(fences, schemas, { trace })) | |||
|
|||
return { | |||
const res = <RunPromptResult>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function 'structurifyChatSession' is missing a return statement. This might cause issues if the function is expected to return a value.
generated by pr-review-commit
missing_return
await writeText(fn, after ?? before) // Write 'after' content if available, otherwise 'before' | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new file 'fileedits.ts' has been added. Please ensure that this new file does not duplicate any existing functionality and that it is correctly integrated into the project.
generated by pr-review-commit
new_file
@@ -458,7 +462,7 @@ function structurifyChatSession( | |||
if (fences?.length) | |||
frames.push(...validateFencesWithSchema(fences, schemas, { trace })) | |||
|
|||
return { | |||
const res = <RunPromptResult>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function 'computeFileEdits' is async and should be awaited to ensure correct execution.
generated by pr-review-commit
missing_await
Investigator reportThe root cause of the failure seems to be related to TypeScript compilation errors in the
These errors indicate that there are unexpected keywords or identifiers starting from the second line of the Suggested FixHere's a diff with suggested fixes to address the errors: --- genaisrc/poem.genai.mts
+++ genaisrc/poem.genai.mts
@@ -1,5 +1,5 @@
-# This is a comment
-function greet() {
- console.log("Hello, world!");
-}
+// Corrected comment syntax
+function greet() {
+ console.log("Hello, world!");
+}
|
It seems that the workflow run with ID "66543451" in the specified branch does not exist or cannot be found. Please check the details and provide any additional information if available.
|
Workflow Status InvestigationWorkflow Runs
Failure Analysis
Code ComparisonNo specific commits were found between the two runs, indicating that the failure might be related to changes not captured by commits or a dependency issue. Recommendations
Please let me know if you need further information or assistance!
|
{ model, system: ["system.git_info", "system.github_info"], tools: ["git"] } | ||
{ | ||
model, | ||
system: ["system.git_info", "system.github_info", "system.git"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The system array should not include "system.git" as it is not a valid system function according to the provided context.
generated by pr-docs-review-commit
incorrect_info
This pull request enhances the file edit handling by refactoring the logic for better modularity and reusability. It updates the imports and improves the functionality related to file edits, including new model configurations. These changes aim to streamline the file editing process and make the codebase more maintainable.
🔄 Refactored File Handling: Replaced the
writeFileEdits
function with a new implementation infileedits.ts
, enhancing file edit operations and validation processes.🗂️ Modularization: Introduced
computeFileEdits
infileedits.ts
to handle file edits, changelogs, and output processing, centralizing these functionalities.🚀 Enhanced Prompt Execution: Improved prompt execution flow by adding support for
fileMerges
,outputProcessors
, andfileOutputs
, allowing more flexible and customizable prompt handling.🛠️ Code Cleanup: Removed redundant code and streamlined several functions, improving readability and maintainability.
📄 Model Update: Changed model from
openai:gpt-3.5-turbo
toopenai:gpt-4o-mini
inrunprompt.genai.js
, potentially improving performance and output quality.🧪 New Test Logic: Added a new test scenario in
runprompt.genai.js
to verify file creation and processing logic, ensuring robustness of new features.openai:gpt-4o-mini
fromopenai:gpt-3.5-turbo
inpackages/sample/genaisrc/style/runprompt.genai.js
for improved performance.writeFileEdits
function inpackages/core/src/run.ts
with a newer version and moved it to a new filepackages/core/src/fileedits.ts
.packages/core/src/chat.ts
to handle file edits, output processors and file merges in a more structured manner with async-functionstructurifyChatSession
.writeFileEdits
frompackages/core/src/edits.ts
, because its functionality was transferred to another module.eval/extrism/genaisrc/extrism-tool.genai.mts
, replaced the hardcoded sample "anagram" with a loop that handles multiple samples dynamically.packages/core/src/promptrunner.ts
andpackages/core/src/runpromptcontext.ts
to support file merges and output processors in prompts.packages/core/src/run.ts
to better handle file edits validation and application.packages/core/src/promptcontext.ts
to reflect the removal ofdefFileMerge
anddefOutputProcessor
methods from prompt context.runprompt.genai.js
script.