Skip to content

fix: set agent timeout default to 600 seconds#703

Merged
namastex888 merged 1 commit into
devfrom
fix/agent-timeout-default-600
Jun 3, 2026
Merged

fix: set agent timeout default to 600 seconds#703
namastex888 merged 1 commit into
devfrom
fix/agent-timeout-default-600

Conversation

@namastex888
Copy link
Copy Markdown
Contributor

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

  • Updates instance/provider default timeout schemas from 60s to 600s.
  • Updates runtime fallback timeout paths to 600s.
  • Updates Agent Config UI fallback, max, and helper text to 600s.
  • Regenerates TypeScript SDK OpenAPI types.

Verification

  • bunx biome check apps/ui/src/components/instances/AgentConfigForm.tsx packages/core/src/schemas/instance.ts packages/db/src/schema.ts packages/api/src/routes/v2/instances.ts packages/api/src/routes/v2/providers.ts packages/api/src/schemas/openapi/instances.ts packages/api/src/schemas/openapi/providers.ts packages/api/src/services/agent-runner.ts packages/api/src/plugins/agent-dispatcher.ts packages/api/src/trpc/router.ts
  • bun test packages/api/src/services/tests/route-resolver.test.ts packages/api/src/plugins/tests/route-config-merge.test.ts packages/api/src/plugins/tests/agent-dispatcher.test.ts
  • bun run typecheck --filter=@omni/api --filter=@omni/ui --filter=@omni/core --filter=@omni/db

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 924894b2-8068-44a8-8cfb-610c72c510b2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/agent-timeout-default-600

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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))}.

Suggested change
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),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Enforce the minimum (10s) and maximum (600s) default timeout limits in the provider schema to match the UI constraints and prevent invalid configurations.

Suggested change
defaultTimeout: z.number().int().positive().default(600),
defaultTimeout: z.number().int().min(10).max(600).default(600),

channel: ChannelTypeSchema,
agentId: z.string().uuid().nullable().optional(),
agentTimeout: z.number().int().positive().default(60),
agentTimeout: z.number().int().positive().default(600),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Enforce the minimum (10s) and maximum (600s) default timeout limits in the provider schema to match the UI constraints.

Suggested change
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' }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Enforce the minimum (10s) and maximum (600s) limits in the OpenAPI schema for instances to ensure accurate API documentation and validation.

Suggested change
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' }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Enforce the minimum (10s) and maximum (600s) limits in the OpenAPI schema for providers.

Suggested change
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),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Enforce the minimum (10s) and maximum (600s) limits in the tRPC router schema for agent timeout.

Suggested change
agentTimeout: z.number().int().positive().default(600),
agentTimeout: z.number().int().min(10).max(600).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),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Enforce the minimum (10s) and maximum (600s) limits in the tRPC router schema for default timeout.

Suggested change
defaultTimeout: z.number().int().positive().default(600),
defaultTimeout: z.number().int().min(10).max(600).default(600),

@namastex888 namastex888 merged commit ec55de6 into dev Jun 3, 2026
10 checks passed
@namastex888 namastex888 deleted the fix/agent-timeout-default-600 branch June 3, 2026 06:15
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/db/src/schema.ts

// ---- Agent Configuration (Instance Override) ----
agentTimeout: integer('agent_timeout').notNull().default(60),
agentTimeout: integer('agent_timeout').notNull().default(600),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines 2481 to 2485
/**
* @description Agent timeout in seconds
* @default 60
* @default 600
*/
agentTimeout: number;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants