@gengjiawen/os-init 2.1.0 → 2.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.1](https://github.com/gengjiawen/os-init/compare/v2.1.0...v2.1.1) (2026-10-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * stop Claude Code auto-mode classifier warning on the gateway ([#55](https://github.com/gengjiawen/os-init/issues/55)) ([8f2470f](https://github.com/gengjiawen/os-init/commit/8f2470fbbfeb5d0e369b491285d2f97d70294dc6))
9
+
3
10
  ## [2.1.0](https://github.com/gengjiawen/os-init/compare/v2.0.0...v2.1.0) (2026-09-30)
4
11
 
5
12
 
@@ -11,6 +11,7 @@ const utils_1 = require("./utils");
11
11
  const CLAUDE_BASE_URL = 'https://ai.gengjiawen.com/api/claude/';
12
12
  const CLAUDE_AUTO_COMPACT_WINDOW = '128000';
13
13
  const CLAUDE_ATTRIBUTION_HEADER = '0';
14
+ const CLAUDE_AUTO_MODE_SERVER = '0';
14
15
  function getClaudeSettingsDir() {
15
16
  return path.join(os.homedir(), '.claude');
16
17
  }
@@ -33,7 +34,8 @@ const CLAUDE_SETTINGS_TEMPLATE = `{
33
34
  "ANTHROPIC_BASE_URL": "${CLAUDE_BASE_URL}",
34
35
  "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
35
36
  "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "${CLAUDE_AUTO_COMPACT_WINDOW}",
36
- "CLAUDE_CODE_ATTRIBUTION_HEADER": "${CLAUDE_ATTRIBUTION_HEADER}"
37
+ "CLAUDE_CODE_ATTRIBUTION_HEADER": "${CLAUDE_ATTRIBUTION_HEADER}",
38
+ "CLAUDE_CODE_AUTO_MODE_SERVER": "${CLAUDE_AUTO_MODE_SERVER}"
37
39
  },
38
40
  "includeCoAuthoredBy": false,
39
41
  "apiKeyHelper": "echo 'API_KEY_PLACEHOLDER'",
@@ -75,6 +77,10 @@ function writeVSCodeClaudePluginConfig(apiKey) {
75
77
  name: 'CLAUDE_CODE_ATTRIBUTION_HEADER',
76
78
  value: CLAUDE_ATTRIBUTION_HEADER,
77
79
  },
80
+ {
81
+ name: 'CLAUDE_CODE_AUTO_MODE_SERVER',
82
+ value: CLAUDE_AUTO_MODE_SERVER,
83
+ },
78
84
  ], {
79
85
  formattingOptions: {
80
86
  insertSpaces: true,
@@ -84,6 +84,7 @@ describe('writeClaudeConfig', () => {
84
84
  expect(claudeSettings).not.toContain('CLAUDE_CODE_DISABLE_1M_CONTEXT')
85
85
  expect(claudeSettings).not.toContain('CLAUDE_CODE_EFFORT_LEVEL')
86
86
  expect(claudeSettings).toContain('"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"')
87
+ expect(claudeSettings).toContain('"CLAUDE_CODE_AUTO_MODE_SERVER": "0"')
87
88
 
88
89
  const vscodeSettings = fs.readFileSync(result.vscodeSettingsPath, 'utf8')
89
90
  expect(vscodeSettings).toContain('"editor.fontSize": 14')
@@ -97,6 +98,7 @@ describe('writeClaudeConfig', () => {
97
98
  expect(vscodeSettings).toContain('"128000"')
98
99
  expect(vscodeSettings).not.toContain('CLAUDE_CODE_DISABLE_1M_CONTEXT')
99
100
  expect(vscodeSettings).toContain('"CLAUDE_CODE_ATTRIBUTION_HEADER"')
101
+ expect(vscodeSettings).toContain('"CLAUDE_CODE_AUTO_MODE_SERVER"')
100
102
  expect(vscodeSettings).toContain('"0"')
101
103
  expect(vscodeSettings).toContain('"1"')
102
104
  expect(vscodeSettings).toContain('"test-api-key"')
@@ -14,6 +14,9 @@ import {
14
14
  const CLAUDE_BASE_URL = 'https://ai.gengjiawen.com/api/claude/'
15
15
  const CLAUDE_AUTO_COMPACT_WINDOW = '128000'
16
16
  const CLAUDE_ATTRIBUTION_HEADER = '0'
17
+ // The gateway does not pass auto-mode server classifier checks through.
18
+ // Leave them off so Claude Code does not warn on every session.
19
+ const CLAUDE_AUTO_MODE_SERVER = '0'
17
20
 
18
21
  /** Return Claude settings directory path */
19
22
  function getClaudeSettingsDir(): string {
@@ -53,7 +56,8 @@ const CLAUDE_SETTINGS_TEMPLATE = `{
53
56
  "ANTHROPIC_BASE_URL": "${CLAUDE_BASE_URL}",
54
57
  "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
55
58
  "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "${CLAUDE_AUTO_COMPACT_WINDOW}",
56
- "CLAUDE_CODE_ATTRIBUTION_HEADER": "${CLAUDE_ATTRIBUTION_HEADER}"
59
+ "CLAUDE_CODE_ATTRIBUTION_HEADER": "${CLAUDE_ATTRIBUTION_HEADER}",
60
+ "CLAUDE_CODE_AUTO_MODE_SERVER": "${CLAUDE_AUTO_MODE_SERVER}"
57
61
  },
58
62
  "includeCoAuthoredBy": false,
59
63
  "apiKeyHelper": "echo 'API_KEY_PLACEHOLDER'",
@@ -113,6 +117,10 @@ function writeVSCodeClaudePluginConfig(apiKey: string): {
113
117
  name: 'CLAUDE_CODE_ATTRIBUTION_HEADER',
114
118
  value: CLAUDE_ATTRIBUTION_HEADER,
115
119
  },
120
+ {
121
+ name: 'CLAUDE_CODE_AUTO_MODE_SERVER',
122
+ value: CLAUDE_AUTO_MODE_SERVER,
123
+ },
116
124
  ],
117
125
  {
118
126
  formattingOptions: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gengjiawen/os-init",
3
3
  "private": false,
4
- "version": "2.1.0",
4
+ "version": "2.1.1",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "bin": {