Bug summary
When the agent is running and the user enters the /tree command, Tau reports an internal error: maximum recursion depth exceded.
That message is not useful to the user and appears to expose an implementation failure rather than explaining what went wrong or how to recover. There is also a typo in the displayed text (exceded instead of exceeded), which makes the error feel less intentional.
This issue should document the production process for investigating and improving the behavior, and can serve as the starting point for a follow-up PR.
How to reproduce it
-
Start Tau in an agent session.
-
While the agent is running, enter the slash command:
-
Observe the error message shown to the user:
maximum recursion depth exceded
Open questions for reproduction:
- Does this happen only while the agent is actively streaming/running, or also when the session is idle?
- Does it depend on the current working directory size or tree depth?
- Is the recursion happening in the
/tree command implementation, the renderer, event handling, or a command/session state interaction?
Proposed direction
- Reproduce the issue with a focused manual test and, if practical, a deterministic automated test.
- Trace where
/tree is handled while the agent is running.
- Identify whether the recursion comes from command dispatch, file-tree generation, event rendering, or concurrent agent/session state.
- Replace the raw recursion failure with a user-facing error that explains the actual problem and suggests a recovery path.
- If recursion is expected for directory walking, consider making the tree traversal iterative or adding safe depth limits.
- Ensure unexpected exceptions from slash commands are caught and rendered consistently, without leaking confusing Python internals as the primary user-facing message.
Expected benefit
- Users get a clear, actionable error instead of an internal Python recursion message.
/tree behaves predictably while the agent is running.
- The command/error-handling path becomes easier to test and maintain.
- The product feels more polished because command failures are presented intentionally.
Tradeoff (if any)
- Adding a safe traversal depth or defensive error handling may hide some implementation details that are useful during development.
- If
/tree is allowed during active agent runs, the implementation may need to account for concurrency or event-ordering complexity.
- If
/tree is blocked during active runs instead, that is simpler but less flexible for users.
Related follow-up
- Audit other slash commands for raw exception messages shown to users.
- Add a standard user-facing command error type or renderer if one does not already exist.
- Consider adding regression coverage for slash commands invoked while the agent is running.
- Review whether
/tree should support configurable max depth or ignored directories.
Acceptance criteria
- The
/tree behavior while the agent is running is reproduced and understood.
- The user no longer sees
maximum recursion depth exceded as the primary error message.
- Any remaining error is spelled correctly, user-facing, and actionable.
- A regression test or documented manual verification path is added.
- The PR notes explain the root cause and the chosen product behavior.
Bug summary
When the agent is running and the user enters the
/treecommand, Tau reports an internal error:maximum recursion depth exceded.That message is not useful to the user and appears to expose an implementation failure rather than explaining what went wrong or how to recover. There is also a typo in the displayed text (
excededinstead ofexceeded), which makes the error feel less intentional.This issue should document the production process for investigating and improving the behavior, and can serve as the starting point for a follow-up PR.
How to reproduce it
Start Tau in an agent session.
While the agent is running, enter the slash command:
Observe the error message shown to the user:
Open questions for reproduction:
/treecommand implementation, the renderer, event handling, or a command/session state interaction?Proposed direction
/treeis handled while the agent is running.Expected benefit
/treebehaves predictably while the agent is running.Tradeoff (if any)
/treeis allowed during active agent runs, the implementation may need to account for concurrency or event-ordering complexity./treeis blocked during active runs instead, that is simpler but less flexible for users.Related follow-up
/treeshould support configurable max depth or ignored directories.Acceptance criteria
/treebehavior while the agent is running is reproduced and understood.maximum recursion depth excededas the primary error message.