Skip to content

Commit 7a81b02

Browse files
authored
feat: add VPC info messages to dev and invoke commands [3/3] (#426)
* feat: add VPC network mode to schema Fix NetworkModeSchema enum from PUBLIC|PRIVATE to PUBLIC|VPC to match the AWS API. Add NetworkConfigSchema for subnet and security group validation, and networkConfig field to AgentEnvSpec with cross-field validation requiring networkConfig when networkMode is VPC. Changes: - Fix NetworkModeSchema enum: PRIVATE → VPC - Add NetworkConfigSchema (subnet/SG ID regex, min/max array bounds) - Add networkConfig optional field to AgentEnvSpec - Add superRefine cross-field validation - Update LLM-compacted schema documentation - Add 13 new unit tests for VPC schema validation * feat: add VPC info messages to dev and invoke commands Add informational messages when agents use VPC network mode: - dev command: Note that VPC networking does not apply locally - invoke command: Guidance about required VPC Endpoints (S3, ECR, Bedrock) and public internet access for non-Bedrock providers
1 parent 4180646 commit 7a81b02

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/cli/commands/dev/command.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ export const registerDev = (program: Command) => {
144144
const targetAgent = project.agents.find(a => a.name === config.agentName);
145145
const providerInfo = targetAgent?.modelProvider ?? '(see agent code)';
146146

147+
if (targetAgent?.networkMode === 'VPC') {
148+
console.warn(
149+
'Warning: This agent uses VPC network mode. Local dev server runs outside your VPC. Network behavior may differ from deployed environment.'
150+
);
151+
}
152+
147153
console.log(`Starting dev server...`);
148154
console.log(`Agent: ${config.agentName}`);
149155
console.log(`Provider: ${providerInfo}`);
@@ -178,6 +184,20 @@ export const registerDev = (program: Command) => {
178184
await new Promise(() => {});
179185
}
180186

187+
// Warn if the target agent uses VPC mode
188+
{
189+
const vpcAgent = opts.agent
190+
? project.agents.find(a => a.name === opts.agent)
191+
: project.agents.length === 1
192+
? project.agents[0]
193+
: undefined;
194+
if (vpcAgent?.networkMode === 'VPC') {
195+
console.warn(
196+
'Warning: This agent uses VPC network mode. Local dev server runs outside your VPC. Network behavior may differ from deployed environment.'
197+
);
198+
}
199+
}
200+
181201
// Enter alternate screen buffer for fullscreen mode
182202
process.stdout.write(ENTER_ALT_SCREEN);
183203

src/cli/commands/invoke/action.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ export async function handleInvoke(context: InvokeContext, options: InvokeOption
6767
return { success: false, error: 'No agents defined in configuration' };
6868
}
6969

70+
if (agentSpec.networkMode === 'VPC') {
71+
console.warn(
72+
'Warning: This agent uses VPC network mode. Invocation may require setting up VPC Endpoints for S3, ECR, Bedrock. If your agent uses a non-Bedrock model provider, VPC will require public internet access.'
73+
);
74+
}
75+
7076
// Get the deployed state for this specific agent
7177
const agentState = targetState?.resources?.agents?.[agentSpec.name];
7278

0 commit comments

Comments
 (0)