codex-copilot-dx 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -59,6 +59,8 @@ On a normal launch, CCDX:
59
59
 
60
60
  The `OPENAI_API_KEY=dummy` value written into the Codex shell environment is only a client-side placeholder. It is not a GitHub credential. CCDX exchanges the saved GitHub OAuth credential for short-lived Copilot service tokens internally.
61
61
 
62
+ On startup, CCDX also adds `context_management = true` under `[features]` when the key is missing, creating the section if needed. Existing values, including `false`, are preserved. Existing inline or dotted `features` declarations and nested context-management settings are left intact to avoid conflicting TOML definitions. This enables Codex's development-stage context-management feature by default for users who have not configured it. A configuration that already matches is not rewritten.
63
+
62
64
  If a compatible adapter is already running, a later launch reuses it and refreshes the local Codex configuration. After updating the package, stop the old adapter before starting the new version; the CLI refuses to silently reuse an incompatible protocol version.
63
65
 
64
66
  ## Version 0.7.0 migration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-copilot-dx",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Use Codex App with GitHub Copilot",
5
5
  "author": "Dale Xiao",
6
6
  "type": "module",
package/src/config.mjs CHANGED
@@ -79,6 +79,32 @@ function setTomlKey(lines, sectionName, key, value) {
79
79
  return true;
80
80
  }
81
81
 
82
+ function ensureContextManagementDefault(lines) {
83
+ const firstSection = lines.findIndex(isTomlTableHeader);
84
+ const topLevel = lines.slice(0, firstSection === -1 ? lines.length : firstSection);
85
+ // Preserve alternative existing TOML declarations rather than creating a
86
+ // conflicting table or replacing a structured context-management value.
87
+ if (topLevel.some((line) => /^\s*(?:features|"features"|'features')\s*(?:=|\.)/.test(line))
88
+ || lines.some((line) => /^\s*\[\s*(?:features|"features"|'features')\s*\.\s*(?:context_management|"context_management"|'context_management')\s*(?:\.|\])/.test(line))) {
89
+ return false;
90
+ }
91
+ const start = lines.findIndex((line) => /^\s*\[\s*(?:features|"features"|'features')\s*\]\s*(?:#.*)?$/.test(line));
92
+ if (start === -1) {
93
+ if (lines.length && lines.at(-1).trim() !== "") lines.push("");
94
+ lines.push("[features]", "context_management = true");
95
+ return true;
96
+ }
97
+
98
+ let end = start + 1;
99
+ while (end < lines.length && !isTomlTableHeader(lines[end])) end += 1;
100
+ if (lines.slice(start + 1, end).some((line) => /^\s*(?:context_management|"context_management"|'context_management')\s*(?:=|\.)/.test(line))) {
101
+ return false;
102
+ }
103
+ while (end > start + 1 && lines[end - 1].trim() === "") end -= 1;
104
+ lines.splice(end, 0, "context_management = true");
105
+ return true;
106
+ }
107
+
82
108
  export function computeUpdatedCodexConfig(content, adapterPort = 2026, adapterHost = "127.0.0.1") {
83
109
  const baseUrl = `${adapterBaseUrl(adapterHost, adapterPort)}/v1`;
84
110
  const hadTrailingNewline = content.endsWith("\n");
@@ -104,6 +130,7 @@ export function computeUpdatedCodexConfig(content, adapterPort = 2026, adapterHo
104
130
  changed = setTopLevelTomlDefault(lines, "model_auto_compact_token_limit", MODEL_AUTO_COMPACT_TOKEN_LIMIT) || changed;
105
131
  changed = setTomlKey(lines, "shell_environment_policy.set", "OPENAI_BASE_URL", baseUrl) || changed;
106
132
  changed = setTomlKey(lines, "shell_environment_policy.set", "OPENAI_API_KEY", "dummy") || changed;
133
+ changed = ensureContextManagementDefault(lines) || changed;
107
134
 
108
135
  return { content: lines.join("\n") + (hadTrailingNewline ? "\n" : ""), changed };
109
136
  }
@@ -120,6 +147,9 @@ inherit = "core"
120
147
  [shell_environment_policy.set]
121
148
  OPENAI_BASE_URL = "${baseUrl}"
122
149
  OPENAI_API_KEY = "dummy"
150
+
151
+ [features]
152
+ context_management = true
123
153
  `;
124
154
  }
125
155