Skip to content

fix(session): auto-continue when model stops with reasoning-only response#6

Closed
Grigory-Rylov wants to merge 3 commits into
devfrom
fix/continue-after-idle
Closed

fix(session): auto-continue when model stops with reasoning-only response#6
Grigory-Rylov wants to merge 3 commits into
devfrom
fix/continue-after-idle

Conversation

@Grigory-Rylov

Copy link
Copy Markdown
Owner

Changes

Core (prompt.ts)

  • Auto-continue on reasoning-only stop: When the model stops with only reasoning parts (no text output, no tool calls), automatically inject a synthetic continue message and retry the provider turn. Prevents sessions from ending prematurely when the model stops mid-thought.
  • Limit: up to 10 auto-continue attempts before exiting the loop.

Bot (vk_longpoll.py)

  • Auto-continue on session.idle: When the main session becomes idle, the bot automatically sends a continuation prompt to keep the agent working.
  • Guard: max 5 auto-continue attempts per session to prevent infinite loops.
  • Counter resets on new user messages and on session recreation (/newsession).
  • Improved SSE event logging with relevant field values (finish, status, sessionID).

Grigory-Rylov and others added 3 commits June 27, 2026 13:03
…onse

Detect pattern where the model finishes with 'stop' after only
producing reasoning text, without making any tool calls. Inject a
synthetic user message to prompt the model to continue, allowing up
to 10 auto-continuations per session to prevent infinite loops.
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@Grigory-Rylov

Copy link
Copy Markdown
Owner Author

Reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant