Skip to content

Commit e951b5e

Browse files
committed
docs: explain that Homebrew installs do not auto-update
Homebrew is deliberately excluded from background auto-install (canAutoInstall), matching gh and Claude Code, but /update and the startup notice implied auto-update exists. Both now state the brew upgrade command and point to the native installer for automatic background updates. ManualUpdateResult carries the install source so the TUI can branch on it.
1 parent 82db68a commit e951b5e

4 files changed

Lines changed: 29 additions & 4 deletions

File tree

.changeset/homebrew-update-hint.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pythoughts/pythinker-code': patch
3+
---
4+
5+
Explain in `/update` and the startup update notice that Homebrew installs do not auto-update, and point to the native installer for automatic background updates.

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,17 @@ export function renderManualUpdateMessage(
168168
sourceDesc = 'unsupported package manager or layout.';
169169
break;
170170
}
171+
const homebrewHint =
172+
source === 'homebrew'
173+
? `Homebrew installs do not auto-update. For automatic background updates, ` +
174+
`switch to the native installer: ${NATIVE_INSTALL_COMMAND_UNIX}\n`
175+
: '';
171176
return (
172177
`A newer version of ${NPM_PACKAGE_NAME} is available ` +
173178
`(${currentVersion} -> ${target.version}).\n` +
174179
`Detected install source: ${sourceDesc}\n` +
175-
`To update manually, run: ${installCommand}\n`
180+
`To update manually, run: ${installCommand}\n` +
181+
homebrewHint
176182
);
177183
}
178184

@@ -717,7 +723,12 @@ export type ManualUpdateResult =
717723
| { readonly status: 'check-failed'; readonly message: string }
718724
| { readonly status: 'started'; readonly version: string }
719725
| { readonly status: 'in-progress'; readonly version: string }
720-
| { readonly status: 'manual'; readonly version: string; readonly command: string };
726+
| {
727+
readonly status: 'manual';
728+
readonly version: string;
729+
readonly command: string;
730+
readonly source: InstallSource;
731+
};
721732

722733
/**
723734
* Explicit user-requested update (TUI `/update`). Unlike the passive
@@ -746,6 +757,7 @@ export async function startManualUpdate(
746757
status: 'manual',
747758
version: target.version,
748759
command: installCommandFor(source, target.version, platform),
760+
source,
749761
};
750762
}
751763

@@ -763,6 +775,7 @@ export async function startManualUpdate(
763775
status: 'manual',
764776
version: target.version,
765777
command: installCommandFor(source, target.version, platform),
778+
source,
766779
};
767780
}
768781

apps/pythinker-code/src/tui/commands/info.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010

1111
import { handleDoctor } from '#/cli/sub/doctor';
1212
import { startManualUpdate } from '#/cli/update/preflight';
13-
import { PYTHINKER_CODE_CHANGELOG_URL } from '#/constant/app';
13+
import { NATIVE_INSTALL_COMMAND_UNIX, PYTHINKER_CODE_CHANGELOG_URL } from '#/constant/app';
1414
import { openUrl } from '#/utils/open-url';
1515
import { buildMcpStatusReportLines } from '../components/messages/mcp-status-panel';
1616
import { buildStatusReportLines } from '../components/messages/status-panel';
@@ -323,7 +323,13 @@ export async function handleUpdateCommand(
323323
);
324324
return;
325325
case 'manual':
326-
host.showNotice(`Update available — v${result.version}`, `Run: ${result.command}`);
326+
host.showNotice(
327+
`Update available — v${result.version}`,
328+
result.source === 'homebrew'
329+
? `Homebrew installs do not auto-update. Run: ${result.command}\n` +
330+
`For automatic background updates, switch to the native installer: ${NATIVE_INSTALL_COMMAND_UNIX}`
331+
: `Run: ${result.command}`,
332+
);
327333
return;
328334
case 'check-failed':
329335
host.showError(`Update check failed: ${result.message}`);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,7 @@ describe('startManualUpdate', () => {
15021502
status: 'manual',
15031503
version: '0.5.0',
15041504
command: 'brew upgrade pythinker-code',
1505+
source: 'homebrew',
15051506
});
15061507
expect(mocks.spawn).not.toHaveBeenCalled();
15071508
});

0 commit comments

Comments
 (0)