Skip to content

Improve AI timeout handling and error messages#9508

Merged
begelundmuller merged 5 commits into
mainfrom
begelundmuller/ai-timeout-and-error-messages
May 29, 2026
Merged

Improve AI timeout handling and error messages#9508
begelundmuller merged 5 commits into
mainfrom
begelundmuller/ai-timeout-and-error-messages

Conversation

@begelundmuller
Copy link
Copy Markdown
Contributor

@begelundmuller begelundmuller commented May 28, 2026

  • Increase admin AIService gRPC timeout from 2 to 10 minutes (on the runtime side, it will still be subject to the AILLMTimeoutSeconds, which is usually lower)
  • Maps context errors (cancellation, deadline) to more user-friendly messages.

@begelundmuller begelundmuller self-assigned this May 28, 2026
@begelundmuller begelundmuller requested a review from pjain1 May 28, 2026 12:40
Comment thread admin/server/server.go
if strings.HasPrefix(fullMethodName, "/rill.admin.v1.AIService") {
return time.Minute * 2
// NOTE: The runtime usually sets a lower timeout through its AILLMTimeoutSeconds config, so this is more of a hard upper bound.
return time.Minute * 10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

llm_timeout_seconds is configurable now through instance config so does this mean setting anything beyond 10 mins is just not useful?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the 10 mins here will be a hard-cap for when using Rill's AI service (won't apply if you bring your own token). Since generating tokens for 10 mins can already run up quite a bill, I think it's safest not to allow calls longer than this. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is good, was just thinking to document somewhere that setting llm_timeout_seconds more than 10 minutes won't help so that user is aware.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree, just added docs about it

@begelundmuller begelundmuller merged commit 99a164f into main May 29, 2026
15 of 19 checks passed
@begelundmuller begelundmuller deleted the begelundmuller/ai-timeout-and-error-messages branch May 29, 2026 13:12
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