@gemies/sdk 10.0.1 → 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@gemies/sdk",
3
- "version": "10.0.1",
3
+ "version": "10.0.3",
4
4
  "description": "The Gemies SDK: the conversation runtime, chat UI, voice calls and dictation for Oxy apps that talk to a gemie",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -377,12 +377,10 @@ export const GemieThread = memo(function GemieThread({
377
377
  </View>
378
378
 
379
379
  {/* Agent execution — in-progress card or completed result card. A run that failed has no
380
- card: it is told with a toast (`useAgentRunFailureToast`). */}
381
- {agentActivity && agentActivity.eventCount > 0 ? (
380
+ card, finished or still open: it is told with a toast (`useAgentRunFailureToast`). */}
381
+ {agentActivity && agentActivity.eventCount > 0 && !agentActivity.hasError ? (
382
382
  agentActivity.isComplete ? (
383
- agentActivity.hasError ? null : (
384
- <AgentResultCard activity={agentActivity} />
385
- )
383
+ <AgentResultCard activity={agentActivity} />
386
384
  ) : (
387
385
  <AgentTaskCard activity={agentActivity} />
388
386
  )
@@ -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,
@@ -20,13 +20,13 @@ export function useAgentRunFailureToast(
20
20
  ) {
21
21
  const { t } = useLabels();
22
22
  // When the turn itself failed, its own toast already says so (`useFailedTurnToast`).
23
- const failed = activity?.isComplete === true && activity.hasError && !failedTurn;
23
+ const failed = activity?.hasError === true && !failedTurn;
24
24
  const detail = activity?.lastError ?? undefined;
25
25
 
26
26
  useEffect(() => {
27
27
  if (!failed) return;
28
28
  toast.error(t('chat.agentRun.taskFailed'), {
29
- id: AGENT_RUN_FAILURE_TOAST_ID,
29
+ id: FAILED_TURN_TOAST_ID,
30
30
  description: detail,
31
31
  duration: AGENT_RUN_FAILURE_TOAST_MS,
32
32
  });