Skip to content

Commit 959404b

Browse files
committed
Add required protocol field to all AgentEnvSpec test fixtures
Making protocol required on AgentEnvSpecSchema means every test fixture that constructs an AgentCoreRuntime object needs protocol: 'HTTP'.
1 parent 476d277 commit 959404b

7 files changed

Lines changed: 37 additions & 0 deletions

File tree

src/cli/commands/logs/__tests__/action.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ describe('resolveAgentContext', () => {
5151
entrypoint: 'main.py' as any,
5252
codeLocation: './agents/my-agent' as any,
5353
runtimeVersion: 'PYTHON_3_12' as const,
54+
protocol: 'HTTP' as const,
5455
},
5556
],
5657
memories: [],
@@ -99,6 +100,7 @@ describe('resolveAgentContext', () => {
99100
entrypoint: 'main.py' as any,
100101
codeLocation: './agents/a' as any,
101102
runtimeVersion: 'PYTHON_3_12' as const,
103+
protocol: 'HTTP' as const,
102104
},
103105
{
104106
type: 'AgentCoreRuntime' as const,
@@ -107,6 +109,7 @@ describe('resolveAgentContext', () => {
107109
entrypoint: 'main.py' as any,
108110
codeLocation: './agents/b' as any,
109111
runtimeVersion: 'PYTHON_3_12' as const,
112+
protocol: 'HTTP' as const,
110113
},
111114
],
112115
memories: [],
@@ -135,6 +138,7 @@ describe('resolveAgentContext', () => {
135138
entrypoint: 'main.py' as any,
136139
codeLocation: './agents/a' as any,
137140
runtimeVersion: 'PYTHON_3_12' as const,
141+
protocol: 'HTTP' as const,
138142
},
139143
{
140144
type: 'AgentCoreRuntime' as const,
@@ -143,6 +147,7 @@ describe('resolveAgentContext', () => {
143147
entrypoint: 'main.py' as any,
144148
codeLocation: './agents/b' as any,
145149
runtimeVersion: 'PYTHON_3_12' as const,
150+
protocol: 'HTTP' as const,
146151
},
147152
],
148153
memories: [],

src/cli/external-requirements/__tests__/checks-extended.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe('requiresUv', () => {
4444
runtimeVersion: 'PYTHON_3_12',
4545
entrypoint: 'main.py' as FilePath,
4646
codeLocation: './app' as DirectoryPath,
47+
protocol: 'HTTP',
4748
},
4849
],
4950
memories: [],
@@ -64,6 +65,7 @@ describe('requiresUv', () => {
6465
runtimeVersion: 'PYTHON_3_12',
6566
entrypoint: 'main.py' as FilePath,
6667
codeLocation: './app' as DirectoryPath,
68+
protocol: 'HTTP',
6769
},
6870
],
6971
memories: [],
@@ -97,6 +99,7 @@ describe('requiresContainerRuntime', () => {
9799
runtimeVersion: 'PYTHON_3_12',
98100
entrypoint: 'main.py' as FilePath,
99101
codeLocation: './app' as DirectoryPath,
102+
protocol: 'HTTP',
100103
},
101104
],
102105
memories: [],
@@ -117,6 +120,7 @@ describe('requiresContainerRuntime', () => {
117120
runtimeVersion: 'PYTHON_3_12',
118121
entrypoint: 'main.py' as FilePath,
119122
codeLocation: './app' as DirectoryPath,
123+
protocol: 'HTTP',
120124
},
121125
],
122126
memories: [],
@@ -148,6 +152,7 @@ describe('requiresContainerRuntime', () => {
148152
runtimeVersion: 'PYTHON_3_12',
149153
entrypoint: 'main.py' as FilePath,
150154
codeLocation: './app' as DirectoryPath,
155+
protocol: 'HTTP',
151156
},
152157
{
153158
type: 'AgentCoreRuntime',
@@ -156,6 +161,7 @@ describe('requiresContainerRuntime', () => {
156161
runtimeVersion: 'PYTHON_3_12',
157162
entrypoint: 'app.py' as FilePath,
158163
codeLocation: './container-app' as DirectoryPath,
164+
protocol: 'HTTP',
159165
},
160166
],
161167
memories: [],
@@ -256,6 +262,7 @@ describe('checkDependencyVersions', () => {
256262
runtimeVersion: 'PYTHON_3_12',
257263
entrypoint: 'main.py' as FilePath,
258264
codeLocation: './app' as DirectoryPath,
265+
protocol: 'HTTP',
259266
},
260267
],
261268
memories: [],

src/cli/operations/dev/__tests__/config.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('getDevConfig', () => {
3434
runtimeVersion: 'NODE_20',
3535
entrypoint: filePath('index.js'), // Not a Python agent
3636
codeLocation: dirPath('./agents/node'),
37+
protocol: 'HTTP',
3738
},
3839
],
3940
memories: [],
@@ -56,6 +57,7 @@ describe('getDevConfig', () => {
5657
runtimeVersion: 'PYTHON_3_12',
5758
entrypoint: filePath('main.py'),
5859
codeLocation: dirPath('./agents/python'),
60+
protocol: 'HTTP',
5961
},
6062
],
6163
memories: [],
@@ -84,6 +86,7 @@ describe('getDevConfig', () => {
8486
runtimeVersion: 'PYTHON_3_12',
8587
entrypoint: filePath('main.py'),
8688
codeLocation: dirPath('./agents/python'),
89+
protocol: 'HTTP',
8790
},
8891
],
8992
memories: [],
@@ -107,6 +110,7 @@ describe('getDevConfig', () => {
107110
runtimeVersion: 'NODE_20',
108111
entrypoint: filePath('index.js'),
109112
codeLocation: dirPath('./agents/node'),
113+
protocol: 'HTTP',
110114
},
111115
],
112116
memories: [],
@@ -128,6 +132,7 @@ describe('getDevConfig', () => {
128132
runtimeVersion: 'PYTHON_3_12',
129133
entrypoint: filePath('main.py'),
130134
codeLocation: dirPath('app/PythonAgent/'),
135+
protocol: 'HTTP',
131136
},
132137
],
133138
memories: [],
@@ -152,6 +157,7 @@ describe('getDevConfig', () => {
152157
runtimeVersion: 'PYTHON_3_12',
153158
entrypoint: filePath('main.py'),
154159
codeLocation: dirPath('./agents/python'),
160+
protocol: 'HTTP',
155161
},
156162
],
157163
memories: [],
@@ -176,6 +182,7 @@ describe('getDevConfig', () => {
176182
runtimeVersion: 'PYTHON_3_12',
177183
entrypoint: filePath('main.py'),
178184
codeLocation: dirPath('./agents/container'),
185+
protocol: 'HTTP',
179186
},
180187
],
181188
memories: [],
@@ -200,6 +207,7 @@ describe('getDevConfig', () => {
200207
runtimeVersion: 'NODE_20',
201208
entrypoint: filePath('index.js'),
202209
codeLocation: dirPath('./agents/container'),
210+
protocol: 'HTTP',
203211
},
204212
],
205213
memories: [],
@@ -224,6 +232,7 @@ describe('getDevConfig', () => {
224232
runtimeVersion: 'PYTHON_3_12',
225233
entrypoint: filePath('app.py:handler'),
226234
codeLocation: dirPath('./agents/fastapi'),
235+
protocol: 'HTTP',
227236
},
228237
],
229238
memories: [],
@@ -253,6 +262,7 @@ describe('getAgentPort', () => {
253262
runtimeVersion: 'PYTHON_3_12',
254263
entrypoint: filePath('main.py'),
255264
codeLocation: dirPath('./agents/a1'),
265+
protocol: 'HTTP',
256266
},
257267
{
258268
type: 'AgentCoreRuntime',
@@ -261,6 +271,7 @@ describe('getAgentPort', () => {
261271
runtimeVersion: 'PYTHON_3_12',
262272
entrypoint: filePath('main.py'),
263273
codeLocation: dirPath('./agents/a2'),
274+
protocol: 'HTTP',
264275
},
265276
],
266277
memories: [],
@@ -313,6 +324,7 @@ describe('getDevSupportedAgents', () => {
313324
runtimeVersion: 'NODE_20',
314325
entrypoint: filePath('index.js'),
315326
codeLocation: dirPath('./agents/node'),
327+
protocol: 'HTTP',
316328
},
317329
],
318330
memories: [],
@@ -334,6 +346,7 @@ describe('getDevSupportedAgents', () => {
334346
runtimeVersion: 'PYTHON_3_12',
335347
entrypoint: filePath('main.py'),
336348
codeLocation: dirPath('./agents/python'),
349+
protocol: 'HTTP',
337350
},
338351
{
339352
type: 'AgentCoreRuntime',
@@ -342,6 +355,7 @@ describe('getDevSupportedAgents', () => {
342355
runtimeVersion: 'NODE_20',
343356
entrypoint: filePath('index.js'),
344357
codeLocation: dirPath('./agents/node'),
358+
protocol: 'HTTP',
345359
},
346360
],
347361
memories: [],
@@ -365,6 +379,7 @@ describe('getDevSupportedAgents', () => {
365379
runtimeVersion: 'PYTHON_3_12',
366380
entrypoint: filePath('main.py'),
367381
codeLocation: dirPath('./agents/container'),
382+
protocol: 'HTTP',
368383
},
369384
],
370385
memories: [],
@@ -388,6 +403,7 @@ describe('getDevSupportedAgents', () => {
388403
runtimeVersion: 'PYTHON_3_12',
389404
entrypoint: filePath('main.py'),
390405
codeLocation: dirPath('./agents/python'),
406+
protocol: 'HTTP',
391407
},
392408
{
393409
type: 'AgentCoreRuntime',
@@ -396,6 +412,7 @@ describe('getDevSupportedAgents', () => {
396412
runtimeVersion: 'PYTHON_3_12',
397413
entrypoint: filePath('app.py'),
398414
codeLocation: dirPath('./agents/container'),
415+
protocol: 'HTTP',
399416
},
400417
],
401418
memories: [],

src/cli/tui/screens/agent/useAddAgent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export function mapByoConfigToAgent(config: AddAgentConfig): AgentEnvSpec {
5959
entrypoint: config.entrypoint as FilePath,
6060
codeLocation: config.codeLocation as DirectoryPath,
6161
runtimeVersion: config.pythonVersion,
62+
protocol: 'HTTP',
6263
networkMode: 'PUBLIC',
6364
};
6465
}

src/lib/schemas/io/__tests__/config-io.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ describe('ConfigIO', () => {
194194
entrypoint: 'main.py',
195195
codeLocation: './app',
196196
runtimeVersion: 'PYTHON_3_13',
197+
protocol: 'HTTP',
197198
},
198199
],
199200
} as any;

src/lib/utils/__tests__/zod.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('validateAgentSchema', () => {
99
entrypoint: 'main.py',
1010
codeLocation: './agents/test',
1111
runtimeVersion: 'PYTHON_3_12',
12+
protocol: 'HTTP',
1213
};
1314

1415
it('returns validated data for valid input', () => {
@@ -69,6 +70,7 @@ describe('validateProjectSchema', () => {
6970
entrypoint: 'main.py',
7071
codeLocation: '.',
7172
runtimeVersion: 'PYTHON_3_12',
73+
protocol: 'HTTP',
7274
};
7375
expect(() =>
7476
validateProjectSchema({

src/schema/schemas/__tests__/agentcore-project.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ describe('AgentCoreProjectSpecSchema', () => {
346346
entrypoint: 'main.py',
347347
codeLocation: './agents/my-agent',
348348
runtimeVersion: 'PYTHON_3_12',
349+
protocol: 'HTTP',
349350
},
350351
],
351352
});
@@ -360,6 +361,7 @@ describe('AgentCoreProjectSpecSchema', () => {
360361
entrypoint: 'main.py',
361362
codeLocation: './agents/my-agent',
362363
runtimeVersion: 'PYTHON_3_12',
364+
protocol: 'HTTP',
363365
};
364366
const result = AgentCoreProjectSpecSchema.safeParse({
365367
...minimalProject,
@@ -415,6 +417,7 @@ describe('AgentCoreProjectSpecSchema', () => {
415417
entrypoint: 'main.py',
416418
codeLocation: './agents/agent1',
417419
runtimeVersion: 'PYTHON_3_12',
420+
protocol: 'HTTP',
418421
},
419422
{
420423
type: 'AgentCoreRuntime',
@@ -423,6 +426,7 @@ describe('AgentCoreProjectSpecSchema', () => {
423426
entrypoint: 'index.ts',
424427
codeLocation: './agents/agent2',
425428
runtimeVersion: 'NODE_20',
429+
protocol: 'HTTP',
426430
},
427431
],
428432
memories: [

0 commit comments

Comments
 (0)