Skip to content

Conversation

@joe-hireable
Copy link

@joe-hireable joe-hireable commented Jul 6, 2025

Introduce a ConversationLogger service for enhanced logging capabilities and add a script to create fine-tuning datasets from conversation logs. Update configurations and error handling to support new features, while ensuring proper logging and dataset formats for Gemini models.


Important

Introduces ConversationLogger for logging conversations and updates create-finetuning-data.ts to generate fine-tuning datasets for Gemini and OpenAI, with comprehensive tests and configuration updates.

  • Logging:
    • Introduces ConversationLogger in ConversationLogger.ts to log user messages, AI responses, and tool calls for fine-tuning datasets.
    • Logs are stored in .roo-logs directory.
  • Dataset Generation:
    • Updates create-finetuning-data.ts to process logs into Gemini and OpenAI fine-tuning datasets.
    • Supports --gemini and --openai flags for format selection.
    • Handles session-specific and depth-limited log processing.
  • Testing:
    • Adds unit and integration tests in ConversationLogger.spec.ts to validate logging and dataset generation.
    • Tests include scenarios for Gemini and OpenAI formats, session-specific processing, and depth-limited processing.
  • Configuration:
    • Updates package.json to include new logging settings and dependencies.

This description was created by Ellipsis for 6a58d28. You can customize this summary. It will automatically update as commits are pushed.

- Implemented `create-finetuning-data.ts` to parse log files and convert them into a fine-tuning dataset format.
- Added functionality to read from a specified input directory and output the dataset to a JSONL file.
- Introduced interfaces for log entries and Gemini message structures to facilitate data processing.
- Enhanced error handling for malformed log entries and directory reading.
- Updated `tsconfig.json` to include necessary TypeScript configurations for the new script.
Add script to convert conversation logs into valid supervised fine-tuning
data for Gemini models. Fixes message ordering for tool calls and ensures
proper structure compliance with Google Cloud documentation.
@joe-hireable joe-hireable requested review from cte, jr and mrubens as code owners July 6, 2025 10:46
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jul 6, 2025
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath
if (workspaceRoot) {
const logger = new ConversationLogger(workspaceRoot)
context.globalState.update("conversationLogger", logger)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider not storing a non-serializable ConversationLogger instance in context.globalState (line 96). Global state is meant for simple serializable data. Perhaps store the logger in a disposable or module-level variable instead.

* @returns The new session ID.
*/
public startNewSession(): string {
this.sessionId = this.generateSessionId()

Check failure

Code scanning / CodeQL

Insecure randomness High

This uses a cryptographically insecure random number generated at
Math.random()
in a security context.
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 6, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jul 6, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 6, 2025
@daniel-lxs
Copy link
Member

Thank you for your contribution. To ensure we can properly review and integrate your work, could you please provide some more context? The scope isn't entirely clear, and we couldn't find an associated issue that this pull request addresses. If this is intended to fix a bug, please feel free to open an issue to discuss the problem and solution so we can figure out if this PR fixes the problem. If this is a new feature, then please submit a detailed feature proposal. This will help us understand the problem you're solving and how your contribution fits into the project. We appreciate you taking the time to contribute to Roo Code!

@daniel-lxs daniel-lxs closed this Jul 10, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 10, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Needs Preliminary Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants