@gemies/sdk 10.0.2 → 10.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useLabels } from '../lib/labels';
|
|
2
|
+
import { FAILED_TURN_TOAST_ID } from './useFailedTurnToast';
|
|
2
3
|
import type { AgentActivityState } from '../runtime/thread/agent-activity';
|
|
3
4
|
import { toast } from '@oxy.so/bloom/toast';
|
|
4
5
|
import { useEffect } from 'react';
|
|
5
6
|
|
|
6
|
-
/** One toast for the run that failed, replaced by the next failure. */
|
|
7
|
-
export const AGENT_RUN_FAILURE_TOAST_ID = 'agent-run-failure';
|
|
8
7
|
const AGENT_RUN_FAILURE_TOAST_MS = 10_000;
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -12,7 +11,8 @@ const AGENT_RUN_FAILURE_TOAST_MS = 10_000;
|
|
|
12
11
|
* thread keeps the person's words and the agent's, and a failure is not part of either. The words
|
|
13
12
|
* are the server's (why it failed), under the app's own line. A run that ended well still leaves its
|
|
14
13
|
* summary card (`AgentResultCard`); this is for the one that did not, unless the turn's own failure
|
|
15
|
-
* toast already told it.
|
|
14
|
+
* toast already told it. The two share one toast id: the run's failure reaches the thread before the
|
|
15
|
+
* turn's does, and the turn's toast, which can Retry, replaces it instead of stacking beside it.
|
|
16
16
|
*/
|
|
17
17
|
export function useAgentRunFailureToast(
|
|
18
18
|
activity: AgentActivityState | null | undefined,
|
|
@@ -26,7 +26,7 @@ export function useAgentRunFailureToast(
|
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
if (!failed) return;
|
|
28
28
|
toast.error(t('chat.agentRun.taskFailed'), {
|
|
29
|
-
id:
|
|
29
|
+
id: FAILED_TURN_TOAST_ID,
|
|
30
30
|
description: detail,
|
|
31
31
|
duration: AGENT_RUN_FAILURE_TOAST_MS,
|
|
32
32
|
});
|