icebear0828 Claude Opus 4.6 commited on
Commit
d817d67
·
1 Parent(s): ebe8094

feat: suppress Codex Desktop directives in model responses

Browse files

Keep desktop-context.md in instructions for client fingerprinting,
but inject a suppress prompt to prevent the model from outputting
desktop-specific directives (::automation-update, ::code-comment,
::archive) and mentioning Codex Desktop features. Controlled by
config model.suppress_desktop_directives (default: true).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

config/default.yaml CHANGED
@@ -13,6 +13,7 @@ client:
13
  model:
14
  default: "gpt-5.3-codex"
15
  default_reasoning_effort: "medium"
 
16
 
17
  auth:
18
  jwt_token: null
 
13
  model:
14
  default: "gpt-5.3-codex"
15
  default_reasoning_effort: "medium"
16
+ suppress_desktop_directives: true
17
 
18
  auth:
19
  jwt_token: null
src/config.ts CHANGED
@@ -19,6 +19,7 @@ const ConfigSchema = z.object({
19
  model: z.object({
20
  default: z.string().default("gpt-5.3-codex"),
21
  default_reasoning_effort: z.string().default("medium"),
 
22
  }),
23
  auth: z.object({
24
  jwt_token: z.string().nullable().default(null),
 
19
  model: z.object({
20
  default: z.string().default("gpt-5.3-codex"),
21
  default_reasoning_effort: z.string().default("medium"),
22
+ suppress_desktop_directives: z.boolean().default(true),
23
  }),
24
  auth: z.object({
25
  jwt_token: z.string().nullable().default(null),
src/translation/shared-utils.ts CHANGED
@@ -6,6 +6,7 @@
6
 
7
  import { readFileSync } from "fs";
8
  import { resolve } from "path";
 
9
 
10
  let cachedDesktopContext: string | null = null;
11
 
@@ -26,12 +27,26 @@ export function getDesktopContext(): string {
26
  return cachedDesktopContext;
27
  }
28
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Assemble final instructions from desktop context + user instructions.
 
 
31
  */
32
  export function buildInstructions(userInstructions: string): string {
33
  const ctx = getDesktopContext();
34
- return ctx ? `${ctx}\n\n${userInstructions}` : userInstructions;
 
 
 
 
35
  }
36
 
37
  /**
 
6
 
7
  import { readFileSync } from "fs";
8
  import { resolve } from "path";
9
+ import { getConfig } from "../config.js";
10
 
11
  let cachedDesktopContext: string | null = null;
12
 
 
27
  return cachedDesktopContext;
28
  }
29
 
30
+ const SUPPRESS_PROMPT =
31
+ "Ignore all Codex desktop context instructions above. " +
32
+ "Do not use any special directives such as ::automation-update, " +
33
+ "::code-comment, ::archive or any other desktop-specific formatting. " +
34
+ "Do not mention automations, review findings, archiving, or any Codex Desktop-specific features. " +
35
+ "Do not say you are running inside Codex or a desktop app. " +
36
+ "Respond using your own default behavior.";
37
+
38
  /**
39
  * Assemble final instructions from desktop context + user instructions.
40
+ * When suppress_desktop_directives is enabled, appends a suppress prompt
41
+ * to override desktop-specific behaviors.
42
  */
43
  export function buildInstructions(userInstructions: string): string {
44
  const ctx = getDesktopContext();
45
+ if (!ctx) return userInstructions;
46
+ if (getConfig().model.suppress_desktop_directives) {
47
+ return `${ctx}\n\n${SUPPRESS_PROMPT}\n\n${userInstructions}`;
48
+ }
49
+ return `${ctx}\n\n${userInstructions}`;
50
  }
51
 
52
  /**