@@ -62,6 +62,53 @@ func TestRenderCodexAgentRoleEscapesControlCharacters(t *testing.T) {
6262 }
6363}
6464
65+ func TestRenderOMPAgentRoleHonorsOverride (t * testing.T ) {
66+ role := agentRole {
67+ Name : "researcher" ,
68+ Description : "Find reliable evidence" ,
69+ Model : "opus" ,
70+ Effort : "high" ,
71+ Instructions : "Compare the sources." ,
72+ OMP : ompRoleOptions {
73+ Model : "gpt-5.6-luna" ,
74+ ThinkingLevel : "xhigh" ,
75+ },
76+ }
77+
78+ got := renderOMPAgentRole (role )
79+ for _ , want := range []string {
80+ `name: "researcher"` ,
81+ "model:\n " ,
82+ `- "gpt-5.6-luna"` ,
83+ `thinking-level: "xhigh"` ,
84+ } {
85+ if ! strings .Contains (got , want ) {
86+ t .Fatalf ("rendered OMP role missing %q:\n %s" , want , got )
87+ }
88+ }
89+ if strings .Contains (got , `- "opus"` ) || strings .Contains (got , "effort:" ) {
90+ t .Fatalf ("OMP role leaked Claude defaults into override:\n %s" , got )
91+ }
92+ }
93+
94+ func TestRenderOMPAgentRoleFallsBackToCanonicalModel (t * testing.T ) {
95+ role := agentRole {
96+ Name : "reviewer" ,
97+ Description : "Reviews code" ,
98+ Model : "opus" ,
99+ Effort : "high" ,
100+ Instructions : "Review carefully." ,
101+ }
102+
103+ got := renderOMPAgentRole (role )
104+ if ! strings .Contains (got , "model:\n " ) || ! strings .Contains (got , `- "opus"` ) {
105+ t .Fatalf ("OMP role did not fall back to canonical model:\n %s" , got )
106+ }
107+ if strings .Contains (got , "thinking-level:" ) {
108+ t .Fatalf ("OMP role invented a thinking-level without an override:\n %s" , got )
109+ }
110+ }
111+
65112func TestRenderDroidAgentRoleMapsModelAndTools (t * testing.T ) {
66113 role := agentRole {
67114 Name : "builder" ,
@@ -173,6 +220,9 @@ model: sonnet
173220effort: high
174221tools: [Read, Grep]
175222color: purple
223+ omp:
224+ model: gpt-5.6-luna
225+ thinking-level: xhigh
176226---
177227
178228Review the change.
@@ -207,10 +257,58 @@ Implement the change.
207257 if len (role .Tools ) != 2 || role .Tools [0 ] != "Read" || role .Tools [1 ] != "Grep" {
208258 t .Fatalf ("unexpected tools: %#v" , role .Tools )
209259 }
260+ if role .OMP .Model != "gpt-5.6-luna" || role .OMP .ThinkingLevel != "xhigh" {
261+ t .Fatalf ("unexpected OMP options: %#v" , role .OMP )
262+ }
210263 if filepath .Base (role .Source ) != "reviewer.md" {
211264 t .Fatalf ("unexpected source: %q" , role .Source )
212265 }
213266}
267+
268+ func TestCanonicalResearcherRendersCodexAtMax (t * testing.T ) {
269+ repoRoot , err := filepath .Abs (filepath .Join (".." , ".." ))
270+ if err != nil {
271+ t .Fatal (err )
272+ }
273+ role , err := loadMarkdownAgentRole (filepath .Join (repoRoot , "agents" , "researcher.md" ))
274+ if err != nil {
275+ t .Fatal (err )
276+ }
277+
278+ got := renderCodexAgentRole (role )
279+ for _ , want := range []string {
280+ `name = "researcher"` ,
281+ `model = "gpt-5.6-luna"` ,
282+ `model_reasoning_effort = "max"` ,
283+ } {
284+ if ! strings .Contains (got , want ) {
285+ t .Fatalf ("canonical researcher Codex role missing %q:\n %s" , want , got )
286+ }
287+ }
288+ }
289+
290+ func TestCanonicalResearcherRendersOMPAtMaximum (t * testing.T ) {
291+ repoRoot , err := filepath .Abs (filepath .Join (".." , ".." ))
292+ if err != nil {
293+ t .Fatal (err )
294+ }
295+ role , err := loadMarkdownAgentRole (filepath .Join (repoRoot , "agents" , "researcher.md" ))
296+ if err != nil {
297+ t .Fatal (err )
298+ }
299+
300+ got := renderOMPAgentRole (role )
301+ for _ , want := range []string {
302+ `name: "researcher"` ,
303+ `- "gpt-5.6-luna"` ,
304+ `thinking-level: "max"` ,
305+ } {
306+ if ! strings .Contains (got , want ) {
307+ t .Fatalf ("canonical researcher OMP role missing %q:\n %s" , want , got )
308+ }
309+ }
310+ }
311+
214312func TestLoadAgentRolesMarkdownRejectsMappingTools (t * testing.T ) {
215313 repoRoot := t .TempDir ()
216314 writeAgentsFixture (t , repoRoot , "invalid.md" , `---
0 commit comments