mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 16:34:00 +01:00
fix: pre-landing review fixes
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
2b477eba8f
commit
b0494942cd
2 files changed
+5
-1
No files matched your search
@@ -546,7 +546,7 @@ function hookPlan(opts: RegisterOptions, dest: string, prev: Ledger | null): Hoo
|
||||
if (!choice.on) return off(plan);
|
||||
const requested = !opts.inherit;
|
||||
const foreign = t.name === 'openclaw' ? foreignOpenclawConfig(opts.env, profile) : '';
|
||||
const [why, fix] = dest !== profileSkills(t.name, profile) ? ['this registration uses another skills folder (' + dest + ')', HARNESS_CODES.HARNESS_HOOK_UNSUPPORTED.fix]
|
||||
const [why, fix] = dest !== profileSkills(t.name, profile) ? ['this registration uses another skills folder (' + dest + ')', 'register without --skills-dir to get the hook, or pass --no-start-hook to keep this registration without it']
|
||||
: foreign ? ['OPENCLAW_CONFIG_PATH points OpenClaw at ' + foreign + ', outside that profile', 'unset OPENCLAW_CONFIG_PATH or set it to ' + hookConfig('openclaw', profile) + ', then register again'] : ['', ''];
|
||||
if (why && (plan.explicit || !prevOn)) {
|
||||
if (plan.explicit) throw new HarnessError('HARNESS_HOOK_UNSUPPORTED', 'the start hook goes into the ' + t.displayName + ' profile ' + profile + ', and ' + why);
|
||||
|
||||
@@ -528,6 +528,10 @@ describe('start hook: HARN-18 smoke defects (GST-778)', () => {
|
||||
expect(fs.existsSync(path.join(r.profile, 'extensions'))).toBe(false);
|
||||
expect(readLedger(res.ledger)!.meta.start_hook).toBe('off');
|
||||
expect(fs.readFileSync(r.config, 'utf8')).toBe(HEALTHY.openclaw);
|
||||
const custom = register({ ...r.o({ skillsDir: path.join(r.d, 'custom', 'skills') }), env: { ...r.env, GSTACK_HARNESS_START_HOOK: '1' } });
|
||||
expect(custom.hook).toMatchObject({ state: 'off', required: true });
|
||||
expect(custom.hook?.fix).toContain('--no-start-hook');
|
||||
expect(register({ ...r.o({ skillsDir: path.join(r.d, 'custom', 'skills'), startHook: false }), env: { ...r.env, GSTACK_HARNESS_START_HOOK: '1' } }).hook).toEqual({ state: 'off' });
|
||||
}, 120_000);
|
||||
|
||||
test('a fresh harness with no config: turning the hook on creates no config, runs no harness command, and fails with the setup to run first', () => {
|
||||
|
||||
Reference in new issue
Block a user