Objective
Make juniorNitro({ maxDuration }) the single source of truth for Junior's
serverless execution budget.
Simple contract
Junior should not require operators to configure the same timeout twice.
When an app sets:
juniorNitro({ maxDuration: 800 });
Junior should use that value both for the generated Vercel function
configuration and for runtime deadline calculations.
- The agent hard deadline leaves enough time to save state before Vercel stops
the function.
- The conversation worker soft-yields earlier than the hard deadline.
- Queue visibility lasts longer than the function can run.
AGENT_TURN_TIMEOUT_MS may make an agent run shorter, but never longer than
the host budget.
- Production may raise
maxDuration to the limit available to its Vercel
project without separately changing runtime environment variables.
Scope
- Inject the build-time
maxDuration value into Junior's generated runtime
configuration.
- Derive the request deadline, conversation-worker soft yield, and queue
visibility timeout from that value using explicit safety buffers.
- Remove
FUNCTION_MAX_DURATION_SECONDS and the legacy
QUEUE_CALLBACK_MAX_DURATION_SECONDS runtime configuration once the generated
value is authoritative.
- Preserve a safe default when
juniorNitro() does not receive maxDuration.
- Add configuration tests proving build and runtime values cannot drift.
Completion
Non-goals
- Automatically discovering Vercel account limits at runtime.
- Choosing the production duration value in this issue.
- Changing turn slice limits or retry policy.
Objective
Make
juniorNitro({ maxDuration })the single source of truth for Junior'sserverless execution budget.
Simple contract
Junior should not require operators to configure the same timeout twice.
When an app sets:
Junior should use that value both for the generated Vercel function
configuration and for runtime deadline calculations.
the function.
AGENT_TURN_TIMEOUT_MSmay make an agent run shorter, but never longer thanthe host budget.
maxDurationto the limit available to its Vercelproject without separately changing runtime environment variables.
Scope
maxDurationvalue into Junior's generated runtimeconfiguration.
visibility timeout from that value using explicit safety buffers.
FUNCTION_MAX_DURATION_SECONDSand the legacyQUEUE_CALLBACK_MAX_DURATION_SECONDSruntime configuration once the generatedvalue is authoritative.
juniorNitro()does not receivemaxDuration.Completion
maxDurationsetting configures both Vercel and Junior runtime budgets.AGENT_TURN_TIMEOUT_MSoverride remains supported.maxDurationwithout adding a matching environment variable.Non-goals