Skip to content

feat: update prompts for browser, command, and filesystem assistants #34

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

cfc4n
Copy link
Member

@cfc4n cfc4n commented Apr 22, 2025

This pull request introduces several updates aimed at improving the flexibility and maintainability of the configuration and prompt-handling mechanisms across multiple services (BrowserServer, CommandServer, and FilesystemServer). The changes include replacing hardcoded prompts with configurable defaults, adding support for external prompt files, and updating dependencies.

Prompt Configuration Enhancements:

  • Centralized Default Prompts: Added default prompts as constants (BrowserPromptDefault, CommandPromptDefault, FileSystemPromptDefault) for BrowserServer, CommandServer, and FilesystemServer to improve maintainability. [1] [2] [3]
  • External Prompt File Support: Introduced a PromptFile field in configuration structs (BrowserConfig, CommandConfig, FileSystemConfig) to allow loading prompts from external files, with fallback to the default prompts. [1] [2] [3]
  • Dynamic Prompt Usage: Updated prompt-handling logic in handlePrompt methods to use the dynamically loaded prompt instead of hardcoded text. [1] [2] [3]

Dependency Updates:

  • Dependency Version Updates: Upgraded several dependencies in go.mod, including github.com/mark3labs/mcp-go (v0.21.0 → v0.21.1) and github.com/go-json-experiment/json. Added github.com/chromedp/cdproto as a new dependency.

Miscellaneous Improvements:

  • Browser Context Cleanup: Improved resource cleanup in the Close method of BrowserServer by introducing a timeout for the Chrome context cancellation.
  • Documentation and Naming: Updated the description of the module flag in cli/cmd/root.go to use consistent capitalization for module names (e.g., Browser, FileSystem).

@cfc4n cfc4n added the enhancement New feature or request label Apr 22, 2025
@cfc4n cfc4n requested a review from Copilot April 22, 2025 14:35
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 22, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces updates to improve prompt configuration and management across Browser, Command, and Filesystem services while also updating dependencies and resource cleanup.

  • Centralized default prompt constants and external prompt file support have been added.
  • Prompt-handling logic now utilizes dynamic configuration instead of hardcoded text.
  • Dependency upgrades and minor CLI flag documentation improvements have been implemented.

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
services/file_system_config.go Adds default prompt constant & external prompt file support
services/file_system.go Updates prompt handling to use the configured prompt
services/command_config.go Introduces default prompt constant & external prompt file handling
services/command.go Adapts prompt handling to use the configurable prompt
services/browser_config.go Adds default prompt constant & external prompt file support
services/browser.go Updates prompt handling and improves browser cleanup with timeout
cli/cmd/root.go Updates CLI flag description for module naming consistency
Files not reviewed (1)
  • go.mod: Language not supported

@cfc4n cfc4n force-pushed the read-prompt-from-file branch from 8fa3881 to 6476c9a Compare April 22, 2025 14:37
@cfc4n cfc4n merged commit 15c4dd9 into master Apr 22, 2025
6 checks passed
@cfc4n cfc4n deleted the read-prompt-from-file branch April 22, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant