Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(cli): honor the no-update startup opt-out (#4251)

他们都不玩了961ab6c8795a
diff --git a/v3/@claude-flow/cli/__tests__/cli.test.ts b/v3/@claude-flow/cli/__tests__/cli.test.ts
index 3b56503dba..e0daa5f84f 100644
--- a/v3/@claude-flow/cli/__tests__/cli.test.ts
+++ b/v3/@claude-flow/cli/__tests__/cli.test.ts
@@ -383,6 +383,31 @@ describe('CLI', () => {
expect(flagsPassed).toBe(true);
});
+ it.each(['--no-update', '--update=false', '--no-update=true'])(
+ 'should skip startup update checks with %s',
+ async (flag) => {
+ const updateCheck = vi.spyOn(
+ cli as unknown as { checkForUpdatesOnStartup(): Promise<void> },
+ 'checkForUpdatesOnStartup'
+ ).mockResolvedValue(undefined);
+
+ await cli.run([flag, '--help']);
+
+ expect(updateCheck).not.toHaveBeenCalled();
+ }
+ );
+
+ it('should retain startup update checks without an opt-out', async () => {
+ const updateCheck = vi.spyOn(
+ cli as unknown as { checkForUpdatesOnStartup(): Promise<void> },
+ 'checkForUpdatesOnStartup'
+ ).mockResolvedValue(undefined);
+
+ await cli.run(['--help']);
+
+ expect(updateCheck).toHaveBeenCalledOnce();
+ });
+
it('should disable color with --no-color', async () => {
const originalColorEnabled = cli['output']['colorEnabled'];
try {
diff --git a/v3/@claude-flow/cli/src/index.ts b/v3/@claude-flow/cli/src/index.ts
index dbdf522121..b36789b2f8 100644
--- a/v3/@claude-flow/cli/src/index.ts
+++ b/v3/@claude-flow/cli/src/index.ts
@@ -133,7 +133,7 @@ export class CLI {
}
// Run startup update check (non-blocking, silent on skip)
- if (!flags.noUpdate && commandPath[0] !== 'update' && !(commandPath[0] === 'doctor' && flags.json)) {
+ if (!flags.noUpdate && flags.update !== false && commandPath[0] !== 'update' && !(commandPath[0] === 'doctor' && flags.json)) {
this.checkForUpdatesOnStartup().catch(() => {/* silent */});
}