Skip to content

[Bug] ContextWindowExceededError after 3 retries in react loop #9103

@johnslim161-lab

Description

@johnslim161-lab

What happened?

Context

We get this error:NoneType' object has no attribute 'next_thought' when we work with observations/trajectories that continue to exceed the context window limit

  • in the forward pass, we run _call_with_potential_trajectory_truncation() (code)

  • this has a hardcoded limit of 3 retries.

  • once that is hit, we return None (code) which causes attribute error over NoneType (code)

Question

  1. What is the expected behavior? Doesn't a while loop until success make more sense?
  2. On our end, we can monkey patch the truncation logic or even add our own logic for long trajectories but I think this is a bug

Steps to reproduce

explained above

DSPy version

3.0.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions