Skip to content

Commit fbb6208

Browse files
committed
fix(config): normalize padded policy wildcards
1 parent 66e10ce commit fbb6208

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/agents/model-visibility-policy.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe("explicit model visibility policy", () => {
217217
const policy = createPolicy({
218218
agents: {
219219
defaults: {
220-
modelPolicy: { allow: ["clawrouter/anthropic /*", " openai / gpt-5.5 "] },
220+
modelPolicy: { allow: [" clawrouter / anthropic / * ", " openai / gpt-5.5 "] },
221221
},
222222
},
223223
});

‎src/config/config.model-ref-validation.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ describe("config model reference validation", () => {
184184
allow: [
185185
" openai / gpt-5.5 ",
186186
"clawrouter/ anthropic/claude-haiku-4-5",
187-
"openai/ns /*",
187+
" openai / * ",
188+
" clawrouter / anthropic / * ",
188189
],
189190
},
190191
},
@@ -198,7 +199,9 @@ describe("config model reference validation", () => {
198199
list: [
199200
{
200201
id: "worker",
201-
modelPolicy: { allow: [" openai / gpt-5.5 ", "openai/ns /*"] },
202+
modelPolicy: {
203+
allow: [" openai / gpt-5.5 ", " openai / * ", " openai / ns / * "],
204+
},
202205
},
203206
],
204207
},

‎src/config/model-policy-ref.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ type ModelPolicyWildcardRef = {
3939
/** Parse and canonicalize a segment-boundary model-policy prefix wildcard. */
4040
export function parseModelPolicyWildcardRef(raw: string): ModelPolicyWildcardRef | null {
4141
const trimmed = raw.trim();
42-
if (!trimmed.endsWith("/*")) {
43-
return null;
44-
}
4542
// Wildcard keys match on segment boundaries, so normalize boundary padding
4643
// before building the canonical key used by policy matching.
4744
const segments = trimmed.split("/").map((segment) => segment.trim());

0 commit comments

Comments
 (0)