Skip to content

Conversation

ks93
Copy link
Contributor

@ks93 ks93 commented Sep 4, 2025

Description

Added a note to the agents.chat() method docstring to inform users that agent execution can exceed the default 30-second timeout. The note provides guidance and an example on how to increase the client's timeout configuration to prevent potential timeout errors. This improves user experience by proactively addressing a common issue with long-running agent operations.

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • The PR title follows the Conventional Commit spec.

Open in Cursor Open in Web

Copy link

cursor bot commented Sep 4, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.79%. Comparing base (ba384ad) to head (b582229).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2316      +/-   ##
==========================================
- Coverage   90.80%   90.79%   -0.01%     
==========================================
  Files         168      168              
  Lines       25014    25014              
==========================================
- Hits        22714    22712       -2     
- Misses       2300     2302       +2     
Files with missing lines Coverage Δ
cognite/client/_api/agents/agents.py 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ks93 ks93 marked this pull request as ready for review September 5, 2025 14:28
@ks93 ks93 requested review from a team as code owners September 5, 2025 14:28
@ks93 ks93 marked this pull request as draft September 5, 2025 14:28
@ks93 ks93 changed the title Update agent execution timeout documentation docs(agents): Update agent execution timeout documentation Sep 5, 2025
@ks93 ks93 marked this pull request as ready for review September 5, 2025 16:46
@haakonvt
Copy link
Contributor

haakonvt commented Sep 6, 2025

I’m okay with introducing a higher timeout setting for these agent APIs that we expect to be «long running»

@ks93
Copy link
Contributor Author

ks93 commented Sep 19, 2025

I’m okay with introducing a higher timeout setting for these agent APIs that we expect to be «long running»

That would be great @haakonvt . How would we do that?

If you experience timeout errors, you can increase the timeout by setting:
>>> client.config.timeout = 60 # Set timeout to 60 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

@ks93 If you change self._post to self._do_request("POST", ...), I believe you can pass an override timeout. Then I would suggest agents API calls were appropriate get bumped to 60 sec and even accept timeout directly, timeout: int = 60

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.

3 participants