Skip to content

Commit 614a0e6

Browse files
committed
fix: address second round of PR review findings
- AGENTS.md: replace a developer-specific absolute file:// link with a repository-relative one, so it resolves in any clone. - preflight.ts: set windowsHide on the detached Windows update spawn — detached child processes get their own console window on Windows regardless of stdio, so stdio: 'ignore' alone did not suppress it.
1 parent d3a04cd commit 614a0e6

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Any OpenAI-compatible endpoint (DeepSeek, Qwen, GLM, Grok, Together AI, Firework
2323

2424
### Model Selection
2525

26-
Flows through the **catalog** ([catalog.ts](file:///Users/panda/Projects/active/pythinker-code-tsc/packages/kosong/src/catalog.ts)):
26+
Flows through the **catalog** ([catalog.ts](packages/kosong/src/catalog.ts)):
2727

2828
1. JSON catalog maps `providerId → models[]` with context window, capabilities, cost, and modality metadata.
2929
2. `inferWireType()` resolves provider → wire type (explicit `type` field, then heuristic on `npm`/`id`).

apps/pythinker-code/src/cli/update/preflight.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,9 @@ async function startBackgroundInstall(
812812

813813
const child = spawn(cmd, [...args], {
814814
detached: true,
815+
// A detached child gets its own console window on Windows regardless
816+
// of stdio; stdio: 'ignore' alone does not suppress it.
817+
windowsHide: platform === 'win32',
815818
stdio: 'ignore',
816819
env: env === undefined ? undefined : { ...process.env, ...env },
817820
});

apps/pythinker-code/test/cli/update/preflight.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ describe('runUpdatePreflight', () => {
312312
expect(mocks.spawn).toHaveBeenCalledWith(
313313
expect.stringMatching(/^npm(\.cmd)?$/),
314314
['install', '-g', '@pythoughts/pythinker-code@0.5.0'],
315-
{ detached: true, stdio: 'ignore' },
315+
{ detached: true, windowsHide: false, stdio: 'ignore' },
316316
);
317317
});
318318

@@ -576,6 +576,7 @@ describe('runUpdatePreflight', () => {
576576
],
577577
{
578578
detached: true,
579+
windowsHide: true,
579580
stdio: 'ignore',
580581
env: expect.objectContaining({ PYTHINKER_VERSION: '0.5.0' }),
581582
},
@@ -633,7 +634,7 @@ describe('runUpdatePreflight', () => {
633634
expect(mocks.spawn).toHaveBeenCalledWith(
634635
expect.stringMatching(/^npm(\.cmd)?$/),
635636
['install', '-g', '@pythoughts/pythinker-code@0.5.0'],
636-
{ detached: true, stdio: 'ignore' },
637+
{ detached: true, windowsHide: false, stdio: 'ignore' },
637638
);
638639
expect(writeUpdateInstallState).toHaveBeenCalledWith(expect.objectContaining({
639640
active: expect.objectContaining({
@@ -816,7 +817,7 @@ describe('runUpdatePreflight', () => {
816817
expect(mocks.spawn).toHaveBeenCalledWith(
817818
expect.stringMatching(/^npm(\.cmd)?$/),
818819
['install', '-g', '@pythoughts/pythinker-code@0.6.0'],
819-
{ detached: true, stdio: 'ignore' },
820+
{ detached: true, windowsHide: false, stdio: 'ignore' },
820821
);
821822
});
822823

@@ -840,7 +841,7 @@ describe('runUpdatePreflight', () => {
840841
expect(mocks.spawn).toHaveBeenCalledWith(
841842
expect.stringMatching(/^npm(\.cmd)?$/),
842843
['install', '-g', '@pythoughts/pythinker-code@0.6.0'],
843-
{ detached: true, stdio: 'ignore' },
844+
{ detached: true, windowsHide: false, stdio: 'ignore' },
844845
);
845846
});
846847

@@ -864,7 +865,7 @@ describe('runUpdatePreflight', () => {
864865
expect(mocks.spawn).toHaveBeenCalledWith(
865866
expect.stringMatching(/^npm(\.cmd)?$/),
866867
['install', '-g', '@pythoughts/pythinker-code@0.6.0'],
867-
{ detached: true, stdio: 'ignore' },
868+
{ detached: true, windowsHide: false, stdio: 'ignore' },
868869
);
869870
});
870871

@@ -1017,7 +1018,7 @@ describe('runUpdatePreflight', () => {
10171018
expect(mocks.spawn).toHaveBeenCalledWith(
10181019
expect.stringMatching(/^npm(\.cmd)?$/),
10191020
['install', '-g', '@pythoughts/pythinker-code@0.5.0'],
1020-
{ detached: true, stdio: 'ignore' },
1021+
{ detached: true, windowsHide: false, stdio: 'ignore' },
10211022
);
10221023
});
10231024

@@ -1307,7 +1308,7 @@ describe('runUpdatePreflight', () => {
13071308
expect(mocks.spawn).toHaveBeenCalledWith(
13081309
expect.stringMatching(/^npm(\.cmd)?$/),
13091310
['install', '-g', '@pythoughts/pythinker-code@0.5.0'],
1310-
{ detached: true, stdio: 'ignore' },
1311+
{ detached: true, windowsHide: false, stdio: 'ignore' },
13111312
);
13121313
expect(track).toHaveBeenCalledWith('update_background_install_started', expect.objectContaining({
13131314
target_version: '0.5.0',
@@ -1433,7 +1434,7 @@ describe('runUpdatePreflight', () => {
14331434
expect(mocks.spawn).toHaveBeenCalledWith(
14341435
expect.stringMatching(/^npm(\.cmd)?$/),
14351436
['install', '-g', '@pythoughts/pythinker-code@0.5.0'],
1436-
{ detached: true, stdio: 'ignore' },
1437+
{ detached: true, windowsHide: false, stdio: 'ignore' },
14371438
);
14381439
expect(track).toHaveBeenCalledWith('update_background_install_started', expect.objectContaining({
14391440
target_version: '0.5.0',

0 commit comments

Comments
 (0)