feat: human error states, operator toasts and a queue/origin view in the omp UI
- classify transport and API failures into a short state with the next step - count undelivered messages and show them next to the sent counter - toast on owner paired, connection recovered and reply not delivered (throttled) - second status line previews the next queued turns - host spinner names the Telegram prompt while its turn runs - sanitize every Telegram-controlled string that reaches the widget
This commit is contained in:
1 parent
9435ff709b
commit
057281a3bb
19 files changed
+862
-22
No files matched your search
@@ -329,6 +329,8 @@ export function registerTelegramLifecycleRuntimeHooks({
|
||||
updateStatus,
|
||||
recordRuntimeEvent,
|
||||
}: TelegramLifecycleBindingDeps): void {
|
||||
// Whether this bridge set the host spinner text, so it only clears its own.
|
||||
let telegramWorkingMessageShown = false;
|
||||
const agentEndResetter = Runtime.createTelegramAgentEndResetter({
|
||||
abort,
|
||||
typing,
|
||||
@@ -589,6 +591,14 @@ export function registerTelegramLifecycleRuntimeHooks({
|
||||
await agentStartWithDedupReset(event, ctx);
|
||||
activityRuntime.onAgentStart(activeTurnRuntime.get()?.target);
|
||||
startAgentActivityTypingLoop(ctx);
|
||||
const telegramTurn = activeTurnRuntime.get();
|
||||
if (telegramTurn) {
|
||||
Pi.setExtensionWorkingMessage(
|
||||
ctx,
|
||||
Status.formatTelegramWorkingMessage(telegramTurn.statusSummary),
|
||||
);
|
||||
telegramWorkingMessageShown = true;
|
||||
}
|
||||
},
|
||||
async onToolExecutionStart(event, ctx) {
|
||||
if (!isSessionContextActive(ctx)) return;
|
||||
@@ -638,6 +648,10 @@ export function registerTelegramLifecycleRuntimeHooks({
|
||||
onAgentSettled(_event, ctx) {
|
||||
if (!isSessionContextActive(ctx)) return;
|
||||
activityRuntime.onAgentSettled();
|
||||
if (telegramWorkingMessageShown) {
|
||||
telegramWorkingMessageShown = false;
|
||||
Pi.setExtensionWorkingMessage(ctx, undefined);
|
||||
}
|
||||
},
|
||||
settleOnTerminalAgentEnd: Pi.isOmpHost(pi),
|
||||
onBeforeAgentStart: Prompts.createTelegramProactiveBeforeAgentStartHook({
|
||||
|
||||
Reference in new issue
Block a user