diff --git a/cmd/odek/main.go b/cmd/odek/main.go index d17f06e..e0e5690 100644 --- a/cmd/odek/main.go +++ b/cmd/odek/main.go @@ -92,21 +92,12 @@ One wrong name wastes an entire iteration. Be precise. // 1. resolved.System (explicit --system / ODEK_SYSTEM / config) // 2. ~/.odek/IDENTITY.md (swappable identity file) // 3. defaultSystem (compiled-in fallback) -// -// After selecting the base, it appends repo directory/URL context. func buildSystemPrompt(resolved config.ResolvedConfig) string { base := resolved.System if base == "" { base = loadIdentityFile() } - if resolved.GithubRepoDirectory != "" { - base += fmt.Sprintf("\n\nRepository directory: %s\nThis is the local clone of the project repository.", resolved.GithubRepoDirectory) - } - if resolved.GithubRepoUrl != "" { - base += fmt.Sprintf("\nRepository URL: %s\nThis is the upstream GitHub repository.\n", resolved.GithubRepoUrl) - } - return base } @@ -176,10 +167,6 @@ type runFlags struct { SandboxUser string // Container user (e.g. "1000:1000") SandboxReadonly *bool // nil = not set; true = read-only mount - // Repo context flags - GithubRepoDirectory string // --github-repo-dir - GithubRepoUrl string // --github-repo-url - Deliver *bool // nil = not set; true = deliver result to default channel } @@ -293,18 +280,6 @@ func parseRunFlags(args []string) (runFlags, error) { } f.SandboxUser = args[i+1] i += 2 - case "--github-repo-dir": - if i+1 >= len(args) { - return f, fmt.Errorf("--github-repo-dir requires a value") - } - f.GithubRepoDirectory = args[i+1] - i += 2 - case "--github-repo-url": - if i+1 >= len(args) { - return f, fmt.Errorf("--github-repo-url requires a value") - } - f.GithubRepoUrl = args[i+1] - i += 2 case "--ctx", "-c": if i+1 >= len(args) { return f, fmt.Errorf("--ctx requires a value") @@ -582,7 +557,6 @@ const defaultConfigTemplate = `{ "no_color": false, "no_agents": false, "system": "", - "github_repo_directory": "", "sandbox_image": "", "sandbox_network": "none", "sandbox_readonly": false, @@ -708,7 +682,6 @@ func initConfig(args []string) error { fmt.Println(" no_color Disable colored output (true/false)") fmt.Println(" no_agents Skip AGENTS.md (true/false)") fmt.Println(" system System prompt override") - fmt.Println(" github_repo_directory Local clone path of the project repo") fmt.Println(" sandbox_image Docker image (alpine:latest if empty)") fmt.Println(" sandbox_network Network mode (none | bridge | host)") fmt.Println(" sandbox_readonly Mount working directory read-only") @@ -765,9 +738,6 @@ func run(args []string) error { SandboxMemory: f.SandboxMemory, SandboxCPUs: f.SandboxCPUs, SandboxUser: f.SandboxUser, - - GithubRepoDirectory: f.GithubRepoDirectory, - GithubRepoUrl: f.GithubRepoUrl, }) // Resolve @references and --ctx file attachments in the task diff --git a/cmd/odek/main_test.go b/cmd/odek/main_test.go index f87d671..67b8d62 100644 --- a/cmd/odek/main_test.go +++ b/cmd/odek/main_test.go @@ -2018,8 +2018,7 @@ func TestBuildSystemPrompt_ExplicitSystemWins(t *testing.T) { os.WriteFile(filepath.Join(homeDir, ".odek", "IDENTITY.md"), []byte("# Identity from file"), 0644) resolved := config.ResolvedConfig{ - System: "Explicit system override", - GithubRepoDirectory: "/tmp/repo", + System: "Explicit system override", } got := buildSystemPrompt(resolved) @@ -2029,9 +2028,6 @@ func TestBuildSystemPrompt_ExplicitSystemWins(t *testing.T) { if strings.Contains(got, "Identity from file") { t.Error("IDENTITY.md content should NOT appear when explicit System is set") } - if !strings.Contains(got, "/tmp/repo") { - t.Error("repo directory should appear in prompt") - } } func TestBuildSystemPrompt_FallsBackToIdentity(t *testing.T) { @@ -2052,17 +2048,12 @@ func TestBuildSystemPrompt_FallsBackToIdentity(t *testing.T) { func TestBuildSystemPrompt_FallsBackToDefault(t *testing.T) { _ = setupTestHome(t) - resolved := config.ResolvedConfig{ - GithubRepoUrl: "https://github.com/test/repo", - } + resolved := config.ResolvedConfig{} got := buildSystemPrompt(resolved) if !strings.Contains(got, "You are odek") { t.Error("expected defaultSystem identity when no override or IDENTITY.md") } - if !strings.Contains(got, "https://github.com/test/repo") { - t.Error("repo URL should appear in prompt") - } } // ── System prompt optimization validation tests ────────────────────────── diff --git a/cmd/odek/repl.go b/cmd/odek/repl.go index 0aa00ef..59db895 100644 --- a/cmd/odek/repl.go +++ b/cmd/odek/repl.go @@ -62,9 +62,6 @@ func replCmd(args []string) error { SandboxUser: f.SandboxUser, }) systemMessage := buildSystemPrompt(resolved) - if resolved.GithubRepoDirectory != "" { - systemMessage += " You can read and modify files here. When asked to update your own code, this is where the source lives." - } // session resume if sess != nil && sess.Sandbox && !resolved.Sandbox { diff --git a/cmd/odek/telegram.go b/cmd/odek/telegram.go index b3e5d2b..f2c83fc 100644 --- a/cmd/odek/telegram.go +++ b/cmd/odek/telegram.go @@ -171,9 +171,6 @@ func telegramCmd(args []string) error { systemMessage += "\n\nQuick Facts (use these, do NOT search):\n" systemMessage += "- odek website: https://odek.21no.de\n" systemMessage += "- Built by: 21no.de (https://21no.de)\n" - if resolved.GithubRepoUrl != "" { - systemMessage += fmt.Sprintf("- Source code: %s\n", resolved.GithubRepoUrl) - } systemMessage += "- Binary name: odek\n" systemMessage += "- Language: Go, minimal dependencies, ~11 MB binary\n" systemMessage += "\n" @@ -197,13 +194,6 @@ func telegramCmd(args []string) error { systemMessage += "- Without file_glob, every readable file in the subtree is opened and scanned.\n" systemMessage += "- For multi-pattern searches, use multi_grep (parallel walk, less overhead).\n" systemMessage += "\n" - // Set working directory to the configured repo directory. - // This ensures tools like search_files scan the project, not /root. - if resolved.GithubRepoDirectory != "" { - if err := os.Chdir(resolved.GithubRepoDirectory); err != nil { - fmt.Fprintf(os.Stderr, "odek telegram: warning: failed to chdir to %s: %v\n", resolved.GithubRepoDirectory, err) - } - } // Telegram-specific system prompt additions // @@ -282,10 +272,6 @@ func telegramCmd(args []string) error { if resolved.Skills.Verbose { b.WriteString("• Skills verbose: on\n") } - if resolved.GithubRepoDirectory != "" { - repo := filepath.Base(resolved.GithubRepoDirectory) - fmt.Fprintf(&b, "• Repo: `%s`\n", repo) - } b.WriteString("\n_Send a message to begin._") return b.String(), nil } diff --git a/internal/config/loader.go b/internal/config/loader.go index 4194325..85b8068 100644 --- a/internal/config/loader.go +++ b/internal/config/loader.go @@ -65,12 +65,6 @@ type CLIFlags struct { SandboxUser string SandboxReadonly *bool // nil = not set - // GithubRepoDirectory is the path to the local clone of the project repo. - GithubRepoDirectory string - - // GithubRepoUrl is the HTTPS URL of the project's GitHub repository. - GithubRepoUrl string - // InteractionMode controls how tool-call progress is surfaced. // "engaging" (default) = emoji-rich narration, progress message edited. // "enhance" = per-tool narrated messages appended, progress header kept. @@ -173,18 +167,6 @@ type FileConfig struct { // Schedules configures the native in-process task scheduler. Schedules *SchedulesConfig `json:"schedules,omitempty"` - // GithubRepoDirectory is the path to the local clone of the project - // repository. Injected into the system prompt so the agent knows - // where source code lives and can self-correct. - // Config: github_repo_directory, ODEK_GITHUB_REPO_DIRECTORY. - GithubRepoDirectory string `json:"github_repo_directory,omitempty"` - - // GithubRepoUrl is the HTTPS URL of the project's GitHub repository. - // Injected into the system prompt so the agent can reference the - // upstream repo for PRs, issues, and documentation links. - // Config: github_repo_url, ODEK_GITHUB_REPO_URL. - GithubRepoUrl string `json:"github_repo_url,omitempty"` - // InteractionMode controls how the agent communicates tool/progress updates. // "engaging" (default) = emoji-rich narration, progress message edited. // "enhance" = per-tool narrated messages, progress header kept. @@ -294,13 +276,6 @@ type ResolvedConfig struct { // Default: enabled=true, max_concurrent=2, timezone="UTC", catchup=false. Schedules ScheduleConfig - // GithubRepoDirectory is the path to the local clone of the project - // repository. Injected into the system prompt. - GithubRepoDirectory string - - // GithubRepoUrl is the HTTPS URL of the project's GitHub repository. - GithubRepoUrl string - // InteractionMode is the resolved interaction style. // Values: "engaging" (default), "enhance", "verbose", or "off". // "engaging" (default), "enhance", or "verbose". @@ -372,8 +347,6 @@ func loadFile(path string) FileConfig { cfg.SandboxMemory = expandEnv(cfg.SandboxMemory) cfg.SandboxCPUs = expandEnv(cfg.SandboxCPUs) cfg.SandboxUser = expandEnv(cfg.SandboxUser) - cfg.GithubRepoDirectory = expandEnv(cfg.GithubRepoDirectory) - cfg.GithubRepoUrl = expandEnv(cfg.GithubRepoUrl) return cfg } @@ -576,16 +549,6 @@ func LoadConfig(cli CLIFlags) ResolvedConfig { cfg.MaxConcurrency = v } - // Github repo directory env var - if v := envString("GITHUB_REPO_DIRECTORY"); v != "" { - cfg.GithubRepoDirectory = v - } - - // Github repo URL env var - if v := envString("GITHUB_REPO_URL"); v != "" { - cfg.GithubRepoUrl = v - } - // InteractionMode env var if v := envString("INTERACTION_MODE"); v != "" { cfg.InteractionMode = v @@ -673,12 +636,6 @@ func LoadConfig(cli CLIFlags) ResolvedConfig { if cli.SandboxUser != "" { cfg.SandboxUser = cli.SandboxUser } - if cli.GithubRepoDirectory != "" { - cfg.GithubRepoDirectory = cli.GithubRepoDirectory - } - if cli.GithubRepoUrl != "" { - cfg.GithubRepoUrl = cli.GithubRepoUrl - } if cli.InteractionMode != "" { cfg.InteractionMode = cli.InteractionMode } @@ -706,8 +663,6 @@ func LoadConfig(cli CLIFlags) ResolvedConfig { Telegram: resolveTelegram(cfg.Telegram), Transcription: resolveTranscription(cfg.Transcription), Schedules: resolveSchedules(cfg.Schedules), - GithubRepoDirectory: cfg.GithubRepoDirectory, - GithubRepoUrl: cfg.GithubRepoUrl, InteractionMode: ifZero(cfg.InteractionMode, "engaging"), ToolProgress: ifZero(cfg.ToolProgress, "all"), } @@ -1103,12 +1058,6 @@ func overlayFile(base, override FileConfig) FileConfig { base.MCPServers[k] = v } } - if override.GithubRepoDirectory != "" { - base.GithubRepoDirectory = override.GithubRepoDirectory - } - if override.GithubRepoUrl != "" { - base.GithubRepoUrl = override.GithubRepoUrl - } if override.InteractionMode != "" { base.InteractionMode = override.InteractionMode }