Skip to content

fix(agent): add holding pattern supervisor detection to prevent conversational stalls#5155

Open
Katsoragi wants to merge 1 commit into
odysseus-dev:devfrom
Katsoragi:personal/agent-holding-pattern
Open

fix(agent): add holding pattern supervisor detection to prevent conversational stalls#5155
Katsoragi wants to merge 1 commit into
odysseus-dev:devfrom
Katsoragi:personal/agent-holding-pattern

Conversation

@Katsoragi

@Katsoragi Katsoragi commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds holding pattern supervisor detection to the agent loop to prevent conversational stalls. It detects when the model writes "holding" phrases (e.g., "one moment", "please wait", "I am now reading/searching/fetching...") but ends the turn without executing any tools. It intercepts this and injects a system nudge instructing the model to output the tool call directly, preventing infinite conversational loops.

Target branch

  • This PR targets dev, not main. All PRs land in dev; main is curated by the maintainer at each release. If your PR is on main by accident, click "Edit" on this PR and change the base.

Linked Issue

Fixes #5162

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app and verified the change works end-to-end.

How to Test

Verify that if the model output contains a holding pattern without a tool call, the supervisor successfully injects a nudge and continues.

Checks Run

  • Run pytest suite: pytest tests/test_agent_loop.py tests/test_loop_breaker_runaway.py (All Passed).

@github-actions github-actions Bot added needs work PR description incomplete — please update before review ready for review Description complete — ready for maintainer review and removed needs work PR description incomplete — please update before review labels Jul 3, 2026
@alteixeira20 alteixeira20 added the bug Something isn't working label Jul 4, 2026
@Katsoragi
Katsoragi force-pushed the personal/agent-holding-pattern branch from cbdaabf to 1f0f927 Compare July 12, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: agent conversational loops on holding patterns

2 participants