From 2a90526f1720e1f70cabb1c0d4513ec7a2b53c3c Mon Sep 17 00:00:00 2001 From: Will Wiriawan Date: Tue, 1 Sep 2026 10:28:49 +0700 Subject: [PATCH 1/2] feat(profiles): isolated installation profiles (--profile) with per-profile named tunnels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two free Claude accounts need two independent connectors. Profiles give each account its own installation: - --profile on the CLI (and C2C_PROFILE env) routes all state to ~/.c2c/profiles// — own installation identity, registry, auth, sessions, and tunnel binding. Default installation stays at ~/.c2c/state. - Broker duplicate-daemon guard: a second broker for the same installation refuses to shadow the live one instead of silently rebinding to an ephemeral port. - Named-tunnel provisioning is profile-aware: each profile provisions its own tunnel (c2c-installation-) so two hostnames can never be routed into one installation's tunnel. --- .serena/.gitignore | 2 + .serena/project.yml | 169 ++++++++++++++++++++++++++++++++ AGENTS.md | 27 +++++ src/broker/server.ts | 15 ++- src/cli/index.ts | 5 + src/config/paths.ts | 4 + src/tunnel/installation.ts | 6 +- src/tunnel/named-provision.ts | 3 +- tests/workspaces-domain.test.ts | 26 +++++ 9 files changed, 254 insertions(+), 3 deletions(-) create mode 100644 .serena/.gitignore create mode 100644 .serena/project.yml create mode 100644 AGENTS.md diff --git a/.serena/.gitignore b/.serena/.gitignore new file mode 100644 index 0000000..2e510af --- /dev/null +++ b/.serena/.gitignore @@ -0,0 +1,2 @@ +/cache +/project.local.yml diff --git a/.serena/project.yml b/.serena/project.yml new file mode 100644 index 0000000..37c342b --- /dev/null +++ b/.serena/project.yml @@ -0,0 +1,169 @@ +# the name by which the project can be referenced within Serena/when chatting with the LLM. +project_name: "c2c" + +# list of language servers to start when using the LSP backend; choose from: +# ada al angular ansible bash +# bsl clojure cpp cpp_ccls crystal +# csharp csharp_omnisharp cue dart deno +# elixir elm erlang fortran fsharp +# gdscript gleam go groovy haskell +# haxe hlsl html java json +# julia kotlin latex lean4 lua +# luau markdown matlab msl nextflow +# nix ocaml pascal perl php +# php_phpactor php_phpantom powershell python python_basedpyright +# python_jedi python_pyrefly python_ty qml r +# rego ruby ruby_solargraph rust scala +# scss solidity svelte swift systemverilog +# terraform toml typescript typescript_vts vue +# wolfram yaml zig +# (This list may be outdated; generated with scripts/print_language_list.py; +# For the current list, see values of the LanguageServerId enum here: +# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py) +# For some languages, there are several alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.) +# Note: +# - For C, use cpp +# - For JavaScript, use typescript +# - For Angular projects, use angular (subsumes typescript+html; requires `npm install` in the project root) +# - For Svelte projects, use svelte (subsumes typescript/javascript for .svelte projects; requires npm) +# - For Deno projects, use deno (serves the same .ts/.js files as typescript; requires the deno CLI on PATH) +# - For SCSS / Sass / plain CSS, use scss (some-sass-language-server handles all three) +# - For Free Pascal/Lazarus, use pascal +# Special requirements: +# Some language servers require additional setup/installations. +# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers +# When using multiple language servers, the first language server that supports a given file will be used for that file. +# The first language server is the default language and the respective language server will be used as a fallback. +# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored. +language_servers: +- typescript + +# the encoding used by text files in the project +# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings +encoding: "utf-8" + +# optional shell command to run before the language backend (LSP or JetBrains) is initialised. +# the command runs in the project root directory and is only executed if the project is trusted +# (see trusted_project_path_patterns in the global configuration). +# serena waits for the command to exit: a non-zero exit code is logged as an error but does not +# abort activation. a per-project timeout (activation_command_timeout, default 180s) is the safety +# backstop for non-terminating commands; on expiry the process is killed and activation continues. +# example: activation_command: "npx nx run-many -t build" +activation_command: + +# maximum time in seconds to wait for activation_command to complete before killing it (default 180s). +# must be a positive number. +activation_command_timeout: 180.0 + +# line ending convention to use when writing source files. +# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default) +# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings. +line_ending: + +# The language backend to use for this project. +# If not set, the global setting from serena_config.yml is used. +# Valid values: LSP, JetBrains +# Note: the backend is fixed at startup. If a project with a different backend +# is activated post-init, an error will be returned. +language_backend: + +# whether to use project's .gitignore files to ignore files +ignore_all_files_in_gitignore: true + +# advanced configuration option allowing to configure language server-specific options. +# Maps the language key to the options. +# The settings are considered only if the project is trusted (see global configuration to define trusted projects). +# See https://oraios.github.io/serena/02-usage/050_configuration.html#language-server-specific-settings +ls_specific_settings: {} + +# list of workspace folder paths (LSP backend only). +# These folders will be used to build up Serena's symbol index. +# Paths must be within the project root and should thus be relative to the project root. +# Furthermore, the paths should not be filtered by ignore settings. +# Default setting: The entire project root folder (".") is considered. +# In (large) monorepos, this can be used to index only subfolders of the project root, e.g. +# ls_workspace_folders: +# - "./subproject1" +# - "./subproject2" +ls_workspace_folders: +- "." + +# list of additional workspace folder paths for cross-package reference support. +# Paths can be absolute or relative to the project root. +# Each folder is registered as an LSP workspace folder, enabling language servers to discover +# symbols and references across package boundaries, but these folders are not indexed by Serena, +# i.e. the respective symbols will not be found using Serena's symbol search tools. +# Example: +# additional_workspace_folders: +# - ../sibling-package +# - ../shared-lib +ls_additional_workspace_folders: [] + +# list of additional paths to ignore in this project. +# Same syntax as gitignore, so you can use * and **. +# Important: quote patterns that start with `*`, otherwise YAML treats them as aliases. +# Example: +# ignored_paths: +# - "examples/**" +# - ".worktrees/**" +# - "**/bin/**" +# - "**/obj/**" +# Note: global ignored_paths from serena_config.yml are also applied additively. +ignored_paths: [] + +# whether the project is in read-only mode +# If set to true, all editing tools will be disabled and attempts to use them will result in an error +# Added on 2025-04-18 +read_only: false + +# list of tool names to exclude. +# This extends the existing exclusions (e.g. from the global configuration) +# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html +excluded_tools: [] + +# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default). +# This extends the existing inclusions (e.g. from the global configuration). +# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html +included_optional_tools: [] + +# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools. +# This cannot be combined with non-empty excluded_tools or included_optional_tools. +# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html +fixed_tools: [] + +# list of mode names that are to be activated by default, overriding the setting in the global configuration. +# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes. +# If the setting is undefined/empty, the default_modes from the global configuration (serena_config.yml) apply. +# Otherwise, this overrides the setting from the global configuration (serena_config.yml). +# Therefore, you can set this to [] if you do not want the default modes defined in the global config to apply +# for this project. +# This setting can, in turn, be overridden by CLI parameters (--mode). +# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes +default_modes: + +# list of mode names to be activated additionally for this project, e.g. ["query-projects"] +# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes. +# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes +added_modes: + +# initial prompt for the project. It will always be given to the LLM upon activating the project +# (contrary to the memories, which are loaded on demand). +initial_prompt: "" + +# time budget (seconds) per tool call for the retrieval of additional symbol information +# such as docstrings or parameter information. +# This overrides the corresponding setting in the global configuration; see the documentation there. +# If null or missing, use the setting from the global configuration. +symbol_info_budget: + +# list of regex patterns which, when matched, mark a memory entry as read‑only. +# Extends the list from the global configuration, merging the two lists. +read_only_memory_patterns: [] + +# list of regex patterns for memories to completely ignore. +# Matching memories will not appear in list_memories or activate_project output +# and cannot be accessed via read_memory or write_memory. +# To access ignored memory files, use the read_file tool on the raw file path. +# Extends the list from the global configuration, merging the two lists. +# Example: ["_archive/.*", "_episodes/.*"] +ignored_memory_patterns: [] diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..d4a7e69 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,27 @@ +# Codex agent instructions + +## C2C profiles (Claude failover) + +This machine runs **two isolated C2C installations**. Use the primary by default; +switch to the backup when the user hits Claude rate limits or says to use the +backup connector. + +| Profile | CLI | MCP URL | Claude account | +| --- | --- | --- | --- | +| **Primary** | `c2c` (no flag) | `https://condor.portfolio.id/mcp` | Account 1 | +| **Backup** | `c2c --profile wiriawan-gmail` | `https://heros.portfolio.id/mcp` | Account 2 (wiriawan@gmail.com) | + +### Rules for Codex + +1. **Default:** prefix nothing — run `c2c use`, `c2c broker status`, `c2c pair`, `c2c doctor`, etc. as plain `c2c …`. +2. **Backup:** when the user says *switch to backup Claude*, *use profile 2*, *rate limited*, or similar, prefix **every** `c2c` command with `--profile wiriawan-gmail` for the rest of the session (or until they say to switch back). +3. **Register both once per project:** if unsure whether this repo is on the backup installation, run: + ```bash + c2c use --json + c2c --profile wiriawan-gmail use --json + ``` +4. **Workspace id** is the same opaque id on both profiles when the canonical project root is the same — tell the user which **Claude account / connector** to use, not a different workspace id. +5. **Pairing** on backup: `c2c --profile wiriawan-gmail pair --json` +6. **Status / repair** on backup: `c2c --profile wiriawan-gmail broker status --json` and `c2c --profile wiriawan-gmail doctor --json` + +Codex does not switch Claude accounts in the browser — the user opens the matching Claude Web account. Codex only selects which local broker installation to register and diagnose. diff --git a/src/broker/server.ts b/src/broker/server.ts index 775d039..a837337 100644 --- a/src/broker/server.ts +++ b/src/broker/server.ts @@ -15,7 +15,7 @@ import type { TunnelProvider } from "../tunnel/provider.js"; import { Logger, nullLogger } from "../logger/index.js"; import { DEFAULT_HOST, DEFAULT_PORT, getStateDir } from "../config/paths.js"; import { SERVICE_NAME, VERSION } from "../version.js"; -import { writeRuntimeState, clearRuntimeState, type RuntimeState } from "../bridge/runtime.js"; +import { writeRuntimeState, clearRuntimeState, probeBridge, type RuntimeState } from "../bridge/runtime.js"; import { createAdminGuard } from "../bridge/admin-guard.js"; import { loadOrCreateInstallation, @@ -333,6 +333,19 @@ export async function startBroker(opts: BrokerOptions = {}): Promise { }); const { server, port } = await listen(app, host, opts.port ?? DEFAULT_PORT); + // Duplicate-daemon guard: if the preferred port was taken and we fell back + // to an ephemeral one, refuse to shadow an already-running broker for the + // same installation (it would split the CLI from the tunnel-bearing broker). + const preferredPort = opts.port ?? DEFAULT_PORT; + if (port !== preferredPort) { + const occupant = await probeBridge(preferredPort); + if (occupant && occupant.workspaceId === installation.installationId) { + server.close(); + throw new Error( + `A broker for this installation is already running on port ${preferredPort}; not starting a duplicate.` + ); + } + } const startedAt = new Date().toISOString(); logger.info( `Broker listening on ${host}:${port} for installation ${installation.installationId} ` + diff --git a/src/cli/index.ts b/src/cli/index.ts index c1fd476..940cbb2 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -161,6 +161,11 @@ program .name("c2c") .description(`${PRODUCT_NAME} — Claude thinks. Codex works.`) .version(VERSION, "-v, --version") + .option("--profile ", "operate an isolated installation (~/.c2c/profiles/)") + .hook("preAction", () => { + const profile = (program.opts().profile as string | undefined)?.trim(); + if (profile) process.env.C2C_PROFILE = profile; + }) .configureHelp({ sortSubcommands: true }); // ---------------------------------------------------------------- serve (internal) diff --git a/src/config/paths.ts b/src/config/paths.ts index 3642a29..2c936c4 100644 --- a/src/config/paths.ts +++ b/src/config/paths.ts @@ -40,6 +40,10 @@ export function getStateDir(): string { const override = process.env.C2C_STATE_DIR; if (override && override.trim() !== "") return path.resolve(override); + // 1b. named profile: an isolated installation (~/.c2c/profiles/) + const profile = process.env.C2C_PROFILE?.trim(); + if (profile) return path.join(getC2cHome(), "profiles", profile); + // 2. the systemwide installation home, once `c2c install` has created it const homeState = path.join(getC2cHome(), "state"); if (fs.existsSync(homeState)) return homeState; diff --git a/src/tunnel/installation.ts b/src/tunnel/installation.ts index ad158e6..e04e555 100644 --- a/src/tunnel/installation.ts +++ b/src/tunnel/installation.ts @@ -95,11 +95,15 @@ export async function resolveInstallationTunnel( message: "Tell me your Cloudflare domain, e.g. example.com", }); } + // Named profiles need their own Cloudflare tunnel; reusing the default + // name would route both profiles' hostnames at one installation. + const profile = process.env.C2C_PROFILE?.trim(); const result = await provisionNamedTunnel({ workspaceId: INSTALLATION_TUNNEL_ID, - workspaceName: "installation", + workspaceName: profile ? `installation-${profile}` : "installation", zone, hostname: opts.hostname, + tunnelName: profile ? `c2c-installation-${profile}` : undefined, }); state = result.state; const { url } = await restartBrokerTunnel(); diff --git a/src/tunnel/named-provision.ts b/src/tunnel/named-provision.ts index 235cfaa..6264ec4 100644 --- a/src/tunnel/named-provision.ts +++ b/src/tunnel/named-provision.ts @@ -188,6 +188,7 @@ export async function provisionNamedTunnel(opts: { workspaceName: string; zone: string; hostname?: string; + tunnelName?: string; account?: CloudflaredAccount; }): Promise { const account = opts.account ?? new ProcessCloudflaredAccount(); @@ -200,7 +201,7 @@ export async function provisionNamedTunnel(opts: { return fallbackState(opts.workspaceId, "invalid_hostname", (error as Error).message); } - const tunnelName = `c2c-${opts.workspaceId}`; + const tunnelName = opts.tunnelName ?? `c2c-${opts.workspaceId}`; try { if (!account.hasCert()) await account.login(); const tunnel = await account.createTunnel(tunnelName); diff --git a/tests/workspaces-domain.test.ts b/tests/workspaces-domain.test.ts index 6c70a94..029e4c9 100644 --- a/tests/workspaces-domain.test.ts +++ b/tests/workspaces-domain.test.ts @@ -263,3 +263,29 @@ describe("state dir precedence", () => { } }); }); + +describe("profile state resolution", () => { + it("routes state to ~/.c2c/profiles/ via C2C_PROFILE", async () => { + const { getStateDir, getC2cHome } = await import("../src/config/paths.js"); + delete process.env.C2C_STATE_DIR; + process.env.C2C_PROFILE = "wiriawan-gmail"; + try { + expect(getStateDir()).toBe(path.join(getC2cHome(), "profiles", "wiriawan-gmail")); + } finally { + delete process.env.C2C_PROFILE; + } + }); + + it("keeps C2C_STATE_DIR stronger than C2C_PROFILE", async () => { + const { getStateDir } = await import("../src/config/paths.js"); + const scratch = makeTmpDir("profile-scratch"); + process.env.C2C_STATE_DIR = scratch; + process.env.C2C_PROFILE = "wiriawan-gmail"; + try { + expect(getStateDir()).toBe(scratch); + } finally { + delete process.env.C2C_STATE_DIR; + delete process.env.C2C_PROFILE; + } + }); +}); From ad00422203049cd1421df2a5df4fe3425287c306 Mon Sep 17 00:00:00 2001 From: Will Wiriawan Date: Tue, 1 Sep 2026 10:30:02 +0700 Subject: [PATCH 2/2] chore: keep machine-local AGENTS.md and .serena out of the repo --- .gitignore | 4 ++ .serena/.gitignore | 2 - .serena/project.yml | 169 -------------------------------------------- AGENTS.md | 27 ------- 4 files changed, 4 insertions(+), 198 deletions(-) delete mode 100644 .serena/.gitignore delete mode 100644 .serena/project.yml delete mode 100644 AGENTS.md diff --git a/.gitignore b/.gitignore index 9989634..ea391f5 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ dist/ .env.* !.env.example coverage/ + +# local agent/machine config (personal hostnames — never commit) +AGENTS.md +.serena/ diff --git a/.serena/.gitignore b/.serena/.gitignore deleted file mode 100644 index 2e510af..0000000 --- a/.serena/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/cache -/project.local.yml diff --git a/.serena/project.yml b/.serena/project.yml deleted file mode 100644 index 37c342b..0000000 --- a/.serena/project.yml +++ /dev/null @@ -1,169 +0,0 @@ -# the name by which the project can be referenced within Serena/when chatting with the LLM. -project_name: "c2c" - -# list of language servers to start when using the LSP backend; choose from: -# ada al angular ansible bash -# bsl clojure cpp cpp_ccls crystal -# csharp csharp_omnisharp cue dart deno -# elixir elm erlang fortran fsharp -# gdscript gleam go groovy haskell -# haxe hlsl html java json -# julia kotlin latex lean4 lua -# luau markdown matlab msl nextflow -# nix ocaml pascal perl php -# php_phpactor php_phpantom powershell python python_basedpyright -# python_jedi python_pyrefly python_ty qml r -# rego ruby ruby_solargraph rust scala -# scss solidity svelte swift systemverilog -# terraform toml typescript typescript_vts vue -# wolfram yaml zig -# (This list may be outdated; generated with scripts/print_language_list.py; -# For the current list, see values of the LanguageServerId enum here: -# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py) -# For some languages, there are several alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.) -# Note: -# - For C, use cpp -# - For JavaScript, use typescript -# - For Angular projects, use angular (subsumes typescript+html; requires `npm install` in the project root) -# - For Svelte projects, use svelte (subsumes typescript/javascript for .svelte projects; requires npm) -# - For Deno projects, use deno (serves the same .ts/.js files as typescript; requires the deno CLI on PATH) -# - For SCSS / Sass / plain CSS, use scss (some-sass-language-server handles all three) -# - For Free Pascal/Lazarus, use pascal -# Special requirements: -# Some language servers require additional setup/installations. -# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers -# When using multiple language servers, the first language server that supports a given file will be used for that file. -# The first language server is the default language and the respective language server will be used as a fallback. -# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored. -language_servers: -- typescript - -# the encoding used by text files in the project -# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings -encoding: "utf-8" - -# optional shell command to run before the language backend (LSP or JetBrains) is initialised. -# the command runs in the project root directory and is only executed if the project is trusted -# (see trusted_project_path_patterns in the global configuration). -# serena waits for the command to exit: a non-zero exit code is logged as an error but does not -# abort activation. a per-project timeout (activation_command_timeout, default 180s) is the safety -# backstop for non-terminating commands; on expiry the process is killed and activation continues. -# example: activation_command: "npx nx run-many -t build" -activation_command: - -# maximum time in seconds to wait for activation_command to complete before killing it (default 180s). -# must be a positive number. -activation_command_timeout: 180.0 - -# line ending convention to use when writing source files. -# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default) -# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings. -line_ending: - -# The language backend to use for this project. -# If not set, the global setting from serena_config.yml is used. -# Valid values: LSP, JetBrains -# Note: the backend is fixed at startup. If a project with a different backend -# is activated post-init, an error will be returned. -language_backend: - -# whether to use project's .gitignore files to ignore files -ignore_all_files_in_gitignore: true - -# advanced configuration option allowing to configure language server-specific options. -# Maps the language key to the options. -# The settings are considered only if the project is trusted (see global configuration to define trusted projects). -# See https://oraios.github.io/serena/02-usage/050_configuration.html#language-server-specific-settings -ls_specific_settings: {} - -# list of workspace folder paths (LSP backend only). -# These folders will be used to build up Serena's symbol index. -# Paths must be within the project root and should thus be relative to the project root. -# Furthermore, the paths should not be filtered by ignore settings. -# Default setting: The entire project root folder (".") is considered. -# In (large) monorepos, this can be used to index only subfolders of the project root, e.g. -# ls_workspace_folders: -# - "./subproject1" -# - "./subproject2" -ls_workspace_folders: -- "." - -# list of additional workspace folder paths for cross-package reference support. -# Paths can be absolute or relative to the project root. -# Each folder is registered as an LSP workspace folder, enabling language servers to discover -# symbols and references across package boundaries, but these folders are not indexed by Serena, -# i.e. the respective symbols will not be found using Serena's symbol search tools. -# Example: -# additional_workspace_folders: -# - ../sibling-package -# - ../shared-lib -ls_additional_workspace_folders: [] - -# list of additional paths to ignore in this project. -# Same syntax as gitignore, so you can use * and **. -# Important: quote patterns that start with `*`, otherwise YAML treats them as aliases. -# Example: -# ignored_paths: -# - "examples/**" -# - ".worktrees/**" -# - "**/bin/**" -# - "**/obj/**" -# Note: global ignored_paths from serena_config.yml are also applied additively. -ignored_paths: [] - -# whether the project is in read-only mode -# If set to true, all editing tools will be disabled and attempts to use them will result in an error -# Added on 2025-04-18 -read_only: false - -# list of tool names to exclude. -# This extends the existing exclusions (e.g. from the global configuration) -# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html -excluded_tools: [] - -# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default). -# This extends the existing inclusions (e.g. from the global configuration). -# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html -included_optional_tools: [] - -# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools. -# This cannot be combined with non-empty excluded_tools or included_optional_tools. -# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html -fixed_tools: [] - -# list of mode names that are to be activated by default, overriding the setting in the global configuration. -# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes. -# If the setting is undefined/empty, the default_modes from the global configuration (serena_config.yml) apply. -# Otherwise, this overrides the setting from the global configuration (serena_config.yml). -# Therefore, you can set this to [] if you do not want the default modes defined in the global config to apply -# for this project. -# This setting can, in turn, be overridden by CLI parameters (--mode). -# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes -default_modes: - -# list of mode names to be activated additionally for this project, e.g. ["query-projects"] -# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes. -# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes -added_modes: - -# initial prompt for the project. It will always be given to the LLM upon activating the project -# (contrary to the memories, which are loaded on demand). -initial_prompt: "" - -# time budget (seconds) per tool call for the retrieval of additional symbol information -# such as docstrings or parameter information. -# This overrides the corresponding setting in the global configuration; see the documentation there. -# If null or missing, use the setting from the global configuration. -symbol_info_budget: - -# list of regex patterns which, when matched, mark a memory entry as read‑only. -# Extends the list from the global configuration, merging the two lists. -read_only_memory_patterns: [] - -# list of regex patterns for memories to completely ignore. -# Matching memories will not appear in list_memories or activate_project output -# and cannot be accessed via read_memory or write_memory. -# To access ignored memory files, use the read_file tool on the raw file path. -# Extends the list from the global configuration, merging the two lists. -# Example: ["_archive/.*", "_episodes/.*"] -ignored_memory_patterns: [] diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index d4a7e69..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,27 +0,0 @@ -# Codex agent instructions - -## C2C profiles (Claude failover) - -This machine runs **two isolated C2C installations**. Use the primary by default; -switch to the backup when the user hits Claude rate limits or says to use the -backup connector. - -| Profile | CLI | MCP URL | Claude account | -| --- | --- | --- | --- | -| **Primary** | `c2c` (no flag) | `https://condor.portfolio.id/mcp` | Account 1 | -| **Backup** | `c2c --profile wiriawan-gmail` | `https://heros.portfolio.id/mcp` | Account 2 (wiriawan@gmail.com) | - -### Rules for Codex - -1. **Default:** prefix nothing — run `c2c use`, `c2c broker status`, `c2c pair`, `c2c doctor`, etc. as plain `c2c …`. -2. **Backup:** when the user says *switch to backup Claude*, *use profile 2*, *rate limited*, or similar, prefix **every** `c2c` command with `--profile wiriawan-gmail` for the rest of the session (or until they say to switch back). -3. **Register both once per project:** if unsure whether this repo is on the backup installation, run: - ```bash - c2c use --json - c2c --profile wiriawan-gmail use --json - ``` -4. **Workspace id** is the same opaque id on both profiles when the canonical project root is the same — tell the user which **Claude account / connector** to use, not a different workspace id. -5. **Pairing** on backup: `c2c --profile wiriawan-gmail pair --json` -6. **Status / repair** on backup: `c2c --profile wiriawan-gmail broker status --json` and `c2c --profile wiriawan-gmail doctor --json` - -Codex does not switch Claude accounts in the browser — the user opens the matching Claude Web account. Codex only selects which local broker installation to register and diagnose.