Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: pin the managed --no-pull refusal hint; reset the CLI exit code after the refused-refresh case

garrytan6350d0223405
diff --git a/test/managed-cycle-pull-upstream.test.ts b/test/managed-cycle-pull-upstream.test.ts
index 84a4893f96..2302e52cea 100644
--- a/test/managed-cycle-pull-upstream.test.ts
+++ b/test/managed-cycle-pull-upstream.test.ts
@@ -114,7 +114,7 @@ for (const backend of backends) {
test(`${backend}: an explicit managed sync without --no-pull keeps refusing (O-ENG-15)`, async () => {
await managedRemoteSource(engine(), async ({ sourceId, root }) => {
await expect(performSync(engine(), { repoPath: root, sourceId, noPull: false, noEmbed: true }))
- .rejects.toMatchObject({ code: 'writer_coordinator_required' });
+ .rejects.toMatchObject({ code: 'writer_coordinator_required', suggestion: `Fast-forward and sync the checkout with gbrain sources refresh ${sourceId}` });
});
}, 120_000);
diff --git a/test/persistence-worktree-refresh.test.ts b/test/persistence-worktree-refresh.test.ts
index 405ca5b9f1..f367fe560a 100644
--- a/test/persistence-worktree-refresh.test.ts
+++ b/test/persistence-worktree-refresh.test.ts
@@ -238,8 +238,9 @@ test('12. an unmanaged brain refuses refresh_not_managed naming gbrain sync, on
expect(JSON.parse(out.join('\n'))).toMatchObject({ status: 'refused', code: 'refresh_not_managed', fix: `gbrain sync --source ${f.alpha}`,
docs: 'docs/guides/write-refusals.md#refresh_not_managed' });
expect(currentExitCode()).toBe(1);
+ } finally {
_resetCliExitVerdictForTests();
- } finally { await f.engine.executeRaw('UPDATE persistence_brain SET enabled=true WHERE singleton=1'); }
+ process.exitCode = 0; await f.engine.executeRaw('UPDATE persistence_brain SET enabled=true WHERE singleton=1'); }
}), 120_000);
test('13. drain starvation: a writer every 50 ms is refused during draining and the refresh completes inside --wait-drain', () => each(async f => {