Skip to content

End a turn whose run went quiet once the runtime says it has no run, or can't say - #1593

Open
davidmckayv wants to merge 2 commits into
mainfrom
stalled-run
Open

davidmckayv wants to merge 2 commits into
mainfrom
stalled-run

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

What this changes

A turn whose run has gone quiet now ends when the runtime says the conversation has no run going, or can't say. Before, it waited for good.

Found in testing, with the service that carries a conversation's events stalled mid-run:

  • The Bot's reply stopped half written and its step said "Running", with Stop up, for as long as anybody watched (200 seconds).
  • The server had given the run up after a minute. Nothing could tell the browser, because a run's events reach it by that same service, and a run that ends without its last event looks exactly like one that is thinking.

The check (app/src/lib/copilot/quiet-run.ts, used in channel-chat.tsx):

  • After 45 seconds with nothing arriving from a run, the runtime is asked whether the conversation still has a run going, by the call a conversation is joined with. It answers the live run's id when there is one.
  • While it says yes, the turn keeps waiting and it is asked again every 45 seconds. A Bot that is thinking or waiting on an app is never cut off.
  • When it says no, the turn ends with "The Bot stopped before it finished. What it saved is shown here. Send a message to carry on." and what the conversation holds is read back.
  • When it can't answer within 15 seconds, the turn ends with "OpenBot lost touch with the Bot before it finished. Try again in a moment, or reload to see what was saved."
  • Between a turn's runs, while the browser takes a step or the person answers a card, nothing is asked.
  • An answer about a run that spoke while the question was out is not taken.

Evidence

Tests (app/tests/quiet-run.test.ts): what each answer from the runtime means, including one that never comes; a quiet run kept while the runtime says it is going and ended when it says it is not; a run that keeps speaking never asked about; nothing asked between a turn's runs; a late answer not taken.

Real product, with the service frozen six seconds into a run:

Before After
Chromium "Running" and Stop for 200 seconds, nothing said Turn ended at 65 seconds with the sentence; Stop gone
WebKit same Turn ended at 64 seconds
Next message after recovery answered answered; the half-written reply is kept above it

Ordinary turns are unchanged: a short answer, and a turn that stops for an approval and carries on, both finished as before.

…or can't say

With the service that carries a conversation's events stalled mid-run, the reply stopped half
written and its step said "Running", with Stop up, for good: the server had given the run
up, and nothing could tell the browser. After 45 seconds with nothing arriving from a run the
runtime is asked whether the conversation still has one going, and again every 45 seconds
while it says yes. When it says no, or cannot answer, the turn ends with a sentence saying so
and what was saved is read back.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant