Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Single-entry user-global registry fixture (regression: #684).
# Its sole entry is also the default, mirroring the issue's reported registry shape.
kbs:
coding:
path: ../../vault-b
description: Fixture single-entry default vault
default: true
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const HOME_WITH_DEFAULT = join(FIXTURES, 'home-with-default');
const HOME_MALFORMED = join(FIXTURES, 'malformed-registry');
const HOME_READONLY_DEFAULT = join(FIXTURES, 'home-readonly-default');
const HOME_READONLY_NAMED = join(FIXTURES, 'home-readonly-named');
const HOME_SINGLE_DEFAULT = join(FIXTURES, 'home-single-default');
// A home directory with no `.agents/kb.yaml`, so the user-global registry resolves empty.
const HOME_EMPTY = FIXTURES;

Expand Down Expand Up @@ -68,6 +69,15 @@ describe(resolveWritableKb, () => {
});
});

it('resolves --kb for a single-entry registry whose sole entry is the default (regression: #684)', async () => {
const result = await resolveWritableKb({ startDir: '/', explicitKb: 'coding', home: HOME_SINGLE_DEFAULT });

expect(result).toEqual({
ok: true,
kb: { name: 'coding', path: VAULT_B, source: 'explicit' },
});
});

it('returns no-kb-resolvable when --kb names an entry that does not exist', async () => {
const result = await resolveWritableKb({ startDir: PROJECT_KB, explicitKb: 'nonexistent', home: HOME_EMPTY });

Expand Down
Loading