-
Notifications
You must be signed in to change notification settings - Fork 36
Add local uvx mode to Serena tool with HTTP transport #10073
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
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot when in local mode, register setup languages with runtime manager |
pkg/workflow/mcp_renderer.go
Outdated
| // Local mode: use HTTP transport | ||
| yaml.WriteString(" type = \"http\"\n") | ||
| yaml.WriteString(" url = \"http://localhost:$GH_AW_SERENA_PORT\"\n") | ||
| yaml.WriteString(" headers = { Authorization = \"$GH_AW_SERENA_API_KEY\" }\n") |
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.
@copilot api key not needed for serena
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.
Done in 8a42c68. Removed API key generation and Authorization header from Serena MCP configuration. The HTTP server now runs without authentication.
| // generateSerenaLocalModeSteps generates steps to start Serena MCP server locally using uvx | ||
| func generateSerenaLocalModeSteps(yaml *strings.Builder) { | ||
| // Step 1: Generate API key and choose port for Serena HTTP server | ||
| yaml.WriteString(" - name: Generate Serena MCP Server Config\n") |
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.
@copilot refactor as shell script in actions/setup/sh
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.
Done in 8a42c68. Refactored inline bash script to actions/setup/sh/start_serena_server.sh with proper error handling and health checks. The workflow now calls bash /opt/gh-aw/actions/start_serena_server.sh instead of inline code.
When Serena runs in local mode with uvx, language services need to be installed on the host machine. This change adds detectSerenaLanguageRuntimes() to automatically detect and register language runtimes (Go, Node, Python, Java, .NET) based on the configured languages in the Serena tool. Maps Serena language names to runtime IDs: - go -> go - typescript/javascript -> node - python -> python - java -> java - csharp -> dotnet Supports both short syntax (serena: ["go"]) and detailed configuration with versions. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in ea29d7c. Added |
- Removed API key generation and Authorization header for Serena MCP (not needed) - Refactored inline bash script to actions/setup/sh/start_serena_server.sh - Updated collectMCPEnvironmentVariables to only pass SERENA_PORT - Simplified generateSerenaLocalModeSteps to call the shell script - Created start_serena_server.sh with proper error handling and health checks Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
@copilot local mode is an error in strict compilation mode |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
Smoke Test ResultsLast 2 merged PRs:
Test Results:
Status: PASS
|
In strict mode, Serena local mode is not allowed because it runs the MCP server directly on the host without containerization, bypassing security isolation. This change adds validateStrictTools() to check for serena with mode: local and reject it in strict mode. Changes: - Added validateStrictTools() to strict_mode_validation.go - Updated validateStrictMode() to call validateStrictTools() - Changed smoke-copilot.md to use default docker mode (removed mode: local) - Added comprehensive tests in strict_mode_serena_test.go The validation provides a clear error message directing users to use docker mode for security. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 809b07c. Added strict mode validation to prevent Serena local mode. In strict mode, local mode is rejected because it runs without containerization, bypassing security isolation. The smoke-copilot workflow now uses default docker mode, and comprehensive tests ensure the validation works correctly. |
|
@copilot make sure the conclusion job "needs" the "agent" job |
The conclusion job already correctly depends on the agent job. The needs array is set at line 311 in notify_comment.go and includes the agent job (passed as mainJobName). Current compilation shows: conclusion:
needs:
- activation
- agent
- detection
- safe_outputs
- update_cache_memoryNo changes needed - this dependency is properly configured. |
|
@copilot fix syntax: Error: Invalid value for '--transport': 'http' is not one of 'stdio', 'sse', 'streamable-http'. |
Changed --transport http to --transport streamable-http in start_serena_server.sh. The Serena CLI only accepts 'stdio', 'sse', or 'streamable-http' as valid transport options. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 5e38449. Changed |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
Smoke Test Results (Run #21036691357)Last 2 Merged PRs:
Test Results:
Overall: PASS (6/7 tests passed; Go unavailable expected in CI environment)
|
|
@copilot Finish adding tests |
Added tests to cover Serena local mode functionality: 1. importable_tools_test.go: - TestImportSerenaLocalMode: Tests importing Serena with local mode, verifies HTTP transport, port config, shell script call, and runtime setups - TestImportSerenaLocalModeMultipleLanguages: Tests local mode with multiple language runtimes (Go, TypeScript, Python) 2. mcp_config_comprehensive_test.go: - TestRenderSerenaMCPConfigLocalMode: Tests MCP config rendering for local mode with HTTP transport vs docker mode with stdio All tests verify: - HTTP transport configuration for local mode - Shell script invocation (start_serena_server.sh) - Language runtime detection and setup - Proper defaults (docker mode when not specified) - No API key/Authorization header in local mode Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in e07befe. Added comprehensive tests for Serena local mode: importable_tools_test.go:
mcp_config_comprehensive_test.go:
All tests pass and verify proper HTTP transport configuration, language runtime detection, and correct defaults. |
Plan: Add Local uvx Mode to Serena Tool
Understand the current architecture
ghcr.io/oraios/serena:latestAdd mode field to SerenaToolConfig
Modefield to SerenaToolConfig (options: "docker", "local")Implement local uvx rendering
Update runtime detection
Strict mode validation
Update smoke-copilot test
Update existing tests
Documentation
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.