fix: set agent timeout default to 600 seconds#703
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request increases the default agent and provider timeouts from 60 to 600 seconds across the application, including UI forms, database schemas, API routes, and OpenAPI specifications. Feedback focuses on enforcing the minimum (10s) and maximum (600s) validation limits across all backend, OpenAPI, and tRPC schemas to align with the UI constraints. Additionally, the reviewer suggests allowing empty values in the UI timeout input state to improve user experience, and recommends regenerating the SDK types from a clean branch to remove unrelated voice-related endpoints and channel types.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| patch?: never; | ||
| trace?: never; | ||
| }; | ||
| "/voice/join": { |
There was a problem hiding this comment.
The regenerated SDK types file contains several new endpoints (such as /voice/join, /voice/leave, /voice/sessions) and channel types (like a2a, twilio-whatsapp, internal) that are unrelated to the agent timeout changes. This suggests the SDK was regenerated from a local environment containing unmerged features. To prevent deploying incomplete API contracts or causing SDK/backend mismatches, please regenerate the SDK types from a clean branch containing only the merged main branch and this PR's changes.
| const [selectedProviderId, setSelectedProviderId] = useState<string | null>(instance.agentProviderId ?? null); | ||
| const [selectedAgentId, setSelectedAgentId] = useState<string | null>(instance.agentId ?? null); | ||
| const [agentTimeout, setAgentTimeout] = useState(instance.agentTimeout ?? 60); | ||
| const [agentTimeout, setAgentTimeout] = useState(instance.agentTimeout ?? 600); |
There was a problem hiding this comment.
To allow users to clear the input field and type a new value without the state immediately casting an empty string to 0 (via Number("")), update the state type to allow number | "". Remember to also update the onChange handler on line 236 to: onChange={(e) => setAgentTimeout(e.target.value === "" ? "" : Number(e.target.value))}.
| const [agentTimeout, setAgentTimeout] = useState(instance.agentTimeout ?? 600); | |
| const [agentTimeout, setAgentTimeout] = useState<number | "">(instance.agentTimeout ?? 600); |
| schemaConfig: MetadataSchema.optional(), | ||
| defaultStream: z.boolean().default(true), | ||
| defaultTimeout: z.number().int().positive().default(60), | ||
| defaultTimeout: z.number().int().positive().default(600), |
There was a problem hiding this comment.
| channel: ChannelTypeSchema, | ||
| agentId: z.string().uuid().nullable().optional(), | ||
| agentTimeout: z.number().int().positive().default(60), | ||
| agentTimeout: z.number().int().positive().default(600), |
There was a problem hiding this comment.
The UI restricts the agent timeout to a range of 10 to 600 seconds (min={10}, max={600}). However, the backend schema only validates that the number is positive. To ensure API contract consistency and prevent clients from setting excessively high timeouts (which could lead to resource exhaustion or hanging connections), we should enforce the same limits in the Zod schema.
| agentTimeout: z.number().int().positive().default(600), | |
| agentTimeout: z.number().int().min(10).max(600).default(600), |
| channel: ChannelTypeSchema.describe('Channel type (e.g., whatsapp-baileys, discord)'), | ||
| agentId: z.string().uuid().nullable().optional().describe('Agent UUID referencing agents table'), | ||
| agentTimeout: z.number().int().positive().default(60).describe('Agent timeout in seconds'), | ||
| agentTimeout: z.number().int().positive().default(600).describe('Agent timeout in seconds'), |
There was a problem hiding this comment.
Enforce the minimum (10s) and maximum (600s) agent timeout limits in the API route schema to match the UI constraints and prevent excessively long timeouts.
| agentTimeout: z.number().int().positive().default(600).describe('Agent timeout in seconds'), | |
| agentTimeout: z.number().int().min(10).max(600).default(600).describe('Agent timeout in seconds'), |
| ), | ||
| defaultStream: z.boolean().default(true).describe('Default streaming setting'), | ||
| defaultTimeout: z.number().int().positive().default(60).describe('Default timeout in seconds'), | ||
| defaultTimeout: z.number().int().positive().default(600).describe('Default timeout in seconds'), |
There was a problem hiding this comment.
Enforce the minimum (10s) and maximum (600s) default timeout limits in the provider schema to match the UI constraints.
| defaultTimeout: z.number().int().positive().default(600).describe('Default timeout in seconds'), | |
| defaultTimeout: z.number().int().min(10).max(600).default(600).describe('Default timeout in seconds'), |
| channel: ChannelTypeSchema.openapi({ description: 'Channel type' }), | ||
| agentId: z.string().uuid().nullable().optional().openapi({ description: 'Agent UUID (agents table)' }), | ||
| agentTimeout: z.number().int().positive().default(60).openapi({ description: 'Agent timeout in seconds' }), | ||
| agentTimeout: z.number().int().positive().default(600).openapi({ description: 'Agent timeout in seconds' }), |
There was a problem hiding this comment.
Enforce the minimum (10s) and maximum (600s) limits in the OpenAPI schema for instances to ensure accurate API documentation and validation.
| agentTimeout: z.number().int().positive().default(600).openapi({ description: 'Agent timeout in seconds' }), | |
| agentTimeout: z.number().int().min(10).max(600).default(600).openapi({ description: 'Agent timeout in seconds' }), |
| }), | ||
| defaultStream: z.boolean().default(true).openapi({ description: 'Default streaming' }), | ||
| defaultTimeout: z.number().int().positive().default(60).openapi({ description: 'Default timeout' }), | ||
| defaultTimeout: z.number().int().positive().default(600).openapi({ description: 'Default timeout' }), |
There was a problem hiding this comment.
Enforce the minimum (10s) and maximum (600s) limits in the OpenAPI schema for providers.
| defaultTimeout: z.number().int().positive().default(600).openapi({ description: 'Default timeout' }), | |
| defaultTimeout: z.number().int().min(10).max(600).default(600).openapi({ description: 'Default timeout' }), |
| agentProviderId: z.string().uuid().optional(), | ||
| agentId: z.string().max(255).default('default'), | ||
| agentTimeout: z.number().int().positive().default(60), | ||
| agentTimeout: z.number().int().positive().default(600), |
| schemaConfig: z.record(z.string(), z.unknown()).optional(), | ||
| defaultStream: z.boolean().default(true), | ||
| defaultTimeout: z.number().int().positive().default(60), | ||
| defaultTimeout: z.number().int().positive().default(600), |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78b7e8555f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // ---- Agent Configuration (Instance Override) ---- | ||
| agentTimeout: integer('agent_timeout').notNull().default(60), | ||
| agentTimeout: integer('agent_timeout').notNull().default(600), |
There was a problem hiding this comment.
Add a migration for the new database defaults
Changing the Drizzle schema here does not update the actual Postgres defaults applied by packages/db/drizzle; the existing migration still creates instances.agent_timeout and agent_providers.default_timeout with DEFAULT 60, and this commit adds no ALTER ... SET DEFAULT migration. In deployed or freshly migrated databases, any DB-level insert that omits these columns will still get 60 seconds despite the schema now advertising 600.
Useful? React with 👍 / 👎.
| /** | ||
| * @description Agent timeout in seconds | ||
| * @default 60 | ||
| * @default 600 | ||
| */ | ||
| agentTimeout: number; |
There was a problem hiding this comment.
Regenerate the non-TypeScript SDK defaults
The TypeScript generated types now document the create-instance default as 600, but the checked-in Python and Go SDKs still construct requests with agentTimeout/defaultTimeout set to 60 (for example packages/sdk-python/.../create_instance_request.py and packages/sdk-go/generated/model_create_instance_request.go). Those clients send the old value explicitly, so users creating instances/providers through them still override the server default back to 60 seconds.
Useful? React with 👍 / 👎.
Why
Homolog Eugenia/Omni needs Agent Timeout standardized at 600s instead of the old 60s default, and the UI must allow the same value instead of capping at 300s.
What
Verification