Prerequisites
Bug Description
The agent (Sisyphus-Junior / gpt-5.2-codex) enters an infinite loop while attempting to fix Python type hint errors reported by Pyright/LSP.
Specifically, it struggles with missing type arguments errors and repeatedly cycles through the same failed strategies:
- Switches from built-in
dict/tuple to typing.Dict/typing.Tuple.
- Checks
lsp_diagnostics.
- Claims the error persists (possibly hallucinating the persistence or misinterpreting the LSP output).
- Switches back to built-in types or attempts to add suppress comments (
# pyright: ignore).
- Repeats this process dozens of times, consuming massive amounts of context (screenshot shows 140k tokens used).
Steps to Reproduce
- Assign a task to Sisyphus-Junior to refactor or fix types in a Python file.
- Trigger a scenario where strict Pyright rules complain about generic types (e.g.,
dict vs dict[str, Any]).
- Observe the agent failing to satisfy the LSP and entering a "Code -> LSP -> Code" infinite loop without stopping or asking for user intervention.
Expected Behavior
The agent should detect that it is repeating the same actions (loop detection). After 2-3 failed attempts to fix the same line/error, it should:
- Stop and report failure.
- Or attempting a brute-force suppression effectively.
- NOT continue burning tokens indefinitely.
Actual Behavior
Infinite loop of futile refactoring until manual termination or context exhaustion.
Environment
- Agent: Sisyphus-Junior
- Model: gpt-5.2-codex
- Task: Python Refactoring (Pyright)
Prerequisites
Bug Description
The agent (Sisyphus-Junior / gpt-5.2-codex) enters an infinite loop while attempting to fix Python type hint errors reported by Pyright/LSP.
Specifically, it struggles with
missing type argumentserrors and repeatedly cycles through the same failed strategies:dict/tupletotyping.Dict/typing.Tuple.lsp_diagnostics.# pyright: ignore).Steps to Reproduce
dictvsdict[str, Any]).Expected Behavior
The agent should detect that it is repeating the same actions (loop detection). After 2-3 failed attempts to fix the same line/error, it should:
Actual Behavior
Infinite loop of futile refactoring until manual termination or context exhaustion.
Environment