Fix opencode server registry identity to use main repo root#428
Open
Fix opencode server registry identity to use main repo root#428
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IsServerRunningForWorktree) in server ensure/health paths.ensureOpenCodeServerRunning.Acceptance Criteria Evidence
1)
ensureOpenCodeServerRunningresolves worktree paths to main repo rootinternal/daemon/socket.go:834(normalizeProjectRoot) andinternal/daemon/socket.go:860(ensureOpenCodeServerRunningentry normalization).2)
getOpenCodeServerPortdoes the same normalizationinternal/daemon/socket.go:1150.3) Only one opencode server is used per repo across worktrees
internal/daemon/opencode_server_project_root_test.go:12.go test ./internal/daemon -run "TestEnsureOpenCodeServerRunningNormalizesWorktreePath|TestPersistManagedServerStartNormalizesProjectRoot" -count=1ok github.com/s22625/orch/internal/daemon 0.934s4)
managed_serversSQLite key uses normalized repo rootinternal/daemon/managed_servers_db.go:264internal/daemon/managed_servers_db.go:282internal/daemon/managed_servers_db.go:302internal/daemon/managed_servers_db.go:331internal/daemon/managed_servers_db_test.go:96(TestPersistManagedServerStartNormalizesProjectRoot).5) Semgrep rule prevents worktree paths passed to
ensureOpenCodeServerRunning.semgrep/architecture.yaml:700(daemon-no-worktree-path-to-ensure-server).6)
make lintpasses with no new violationsmake lintScan completed successfully. Findings: 0 (0 blocking)7) Existing tests pass; add test for two worktrees same port
internal/daemon/opencode_server_project_root_test.go:12internal/daemon/managed_servers_db_test.go:96go test ./internal/daemon -count=1ok github.com/s22625/orch/internal/daemon 5.220sgo test ./...fails ininternal/cli(TestApplyConfigDefaultsFallbacks) andtest/integration(opencode integration startup), whileinternal/daemonpasses.8)
go build ./...passesgo build ./...Issue
orch-445