@memberjunction/ng-conversations 6.1.0-edge.3 → 6.1.0-edge.5
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/dist/lib/components/conversation/conversation-chat-area.component.d.ts +2 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +24 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +23 -0
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +144 -49
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +1 -0
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +52 -8
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +65 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +134 -41
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +13 -3
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +7 -8
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +188 -1
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +228 -25
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/search.service.d.ts +10 -4
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +16 -11
- package/dist/lib/services/search.service.js.map +1 -1
- package/package.json +31 -31
|
@@ -274,6 +274,8 @@ export declare class MessageInputComponent extends BaseAngularComponent implemen
|
|
|
274
274
|
converationManagerAgent: MJAIAgentEntityExtended | null;
|
|
275
275
|
private completionTimestamps;
|
|
276
276
|
private registeredCallbacks;
|
|
277
|
+
private static readonly IN_FLIGHT_WATCH_BACKOFF_MS;
|
|
278
|
+
private inFlightWatches;
|
|
277
279
|
private pendingAttachments;
|
|
278
280
|
private engine;
|
|
279
281
|
private mentionAutocomplete;
|
|
@@ -626,6 +628,27 @@ export declare class MessageInputComponent extends BaseAngularComponent implemen
|
|
|
626
628
|
* mention stripping and the sidebar rename animation event.
|
|
627
629
|
*/
|
|
628
630
|
private nameConversation;
|
|
631
|
+
/**
|
|
632
|
+
* Persist an agent failure onto the response bubble.
|
|
633
|
+
*
|
|
634
|
+
* A dropped HTTP/WebSocket path used to return `null` from invokeSubAgent, so
|
|
635
|
+
* the bubble said "Unknown error" while the AIAgentRun stayed Running and the
|
|
636
|
+
* timer kept ticking. If the transport ACKed the mutation and then died, keep
|
|
637
|
+
* In-Progress so a later completion event (or {@link startInFlightDetailWatch})
|
|
638
|
+
* can land. ConversationDetail.Status is the server's claim; the client only
|
|
639
|
+
* renders it. The GraphQLAIClient stall reconciler covers the wait inside
|
|
640
|
+
* invokeSubAgent; once that returns, the watch observes the detail until the
|
|
641
|
+
* server writes a terminal status (MaxTimePerRun).
|
|
642
|
+
*
|
|
643
|
+
* Always completes the user message — the user turn finished regardless of
|
|
644
|
+
* what the agent is doing.
|
|
645
|
+
*/
|
|
646
|
+
private applyAgentFailureToDetail;
|
|
647
|
+
private startInFlightDetailWatch;
|
|
648
|
+
private scheduleInFlightDetailPoll;
|
|
649
|
+
private pollInFlightDetail;
|
|
650
|
+
private stopInFlightDetailWatch;
|
|
651
|
+
private clearInFlightWatches;
|
|
629
652
|
/**
|
|
630
653
|
* Marks a conversation detail as complete and records timestamp to prevent race conditions
|
|
631
654
|
* Emits event to parent to refresh agent run data from database
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9I,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAwH,MAAM,+BAA+B,CAAC;AACjM,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAsB,MAAM,8BAA8B,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAkD,MAAM,+CAA+C,CAAC;AAI7I,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"message-input.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9I,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BA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,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,0BAA0B;YASpB,kBAAkB;IAqBhC,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,oBAAoB;IAO5B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAgD3B;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAW1B;;OAEG;IACH,OAAO,CAAC,0BAA0B;yCA30FvB,qBAAqB;2CAArB,qBAAqB;CAi1FjC"}
|
|
@@ -4,7 +4,7 @@ import { MJEnvironmentEntityExtended, ConversationEngine, UserInfoEngine, TaskGr
|
|
|
4
4
|
import { BeforeAgentTurnEventArgs, AfterAgentTurnEventArgs } from '../../events/chat-events';
|
|
5
5
|
import { GenerateAndApplyConversationName } from '../../services/conversation-naming';
|
|
6
6
|
import { AIEngineBase } from '@memberjunction/ai-engine-base';
|
|
7
|
-
import { ConversationUtility } from '@memberjunction/ai-core-plus';
|
|
7
|
+
import { ConversationUtility, agentFailureDisposition, agentFailureMessage } from '@memberjunction/ai-core-plus';
|
|
8
8
|
import { MentionAutocompleteService } from '../../services/mention-autocomplete.service';
|
|
9
9
|
import { PlanModePreference } from '../../utils/plan-mode-preference';
|
|
10
10
|
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
@@ -388,6 +388,13 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
388
388
|
completionTimestamps = new Map();
|
|
389
389
|
// Track registered streaming callbacks for cleanup
|
|
390
390
|
registeredCallbacks = new Map();
|
|
391
|
+
// After a post-ACK disconnect, keep observing ConversationDetail.Status until
|
|
392
|
+
// the *server* writes Complete/Error (MaxTimePerRun terminates the run).
|
|
393
|
+
// Back off 5s → 15s → 60s so we bound polling cost, not invent a client
|
|
394
|
+
// verdict. Do not paint Error here — that would unregister the streaming
|
|
395
|
+
// callback and make a later server Complete sticky-wrong until reload.
|
|
396
|
+
static IN_FLIGHT_WATCH_BACKOFF_MS = [5_000, 15_000, 60_000];
|
|
397
|
+
inFlightWatches = new Map();
|
|
391
398
|
// Track pending attachments from the input box
|
|
392
399
|
pendingAttachments = [];
|
|
393
400
|
engine = ConversationEngine.Instance;
|
|
@@ -488,6 +495,7 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
488
495
|
ngOnDestroy() {
|
|
489
496
|
// Unregister all streaming callbacks
|
|
490
497
|
this.unregisterAllCallbacks();
|
|
498
|
+
this.clearInFlightWatches();
|
|
491
499
|
this.realtimeActiveSub?.unsubscribe();
|
|
492
500
|
// If the user navigates away mid-call, tear the session down.
|
|
493
501
|
if (this.realtimeSession.IsActive) {
|
|
@@ -1473,13 +1481,8 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
1473
1481
|
// DO NOT remove here - agent may still be streaming/processing
|
|
1474
1482
|
taskId = null; // Clear reference but don't remove from service
|
|
1475
1483
|
if (!result || !result.success) {
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
conversationManagerMessage.Error = errorMsg;
|
|
1479
|
-
await this.updateConversationDetail(conversationManagerMessage, `❌ Evaluation failed`, 'Error');
|
|
1480
|
-
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
1481
|
-
console.warn('⚠️ Sage failed:', result?.agentRun?.ErrorMessage);
|
|
1482
|
-
// Clean up completion timestamp
|
|
1484
|
+
await this.applyAgentFailureToDetail(conversationManagerMessage, userMessage, this.converationManagerAgent?.Name || 'Sage', result, 'failed');
|
|
1485
|
+
console.warn('⚠️ Sage failed:', agentFailureMessage(result, 'Agent evaluation failed'));
|
|
1483
1486
|
this.cleanupCompletionTimestamp(conversationManagerMessage.ID);
|
|
1484
1487
|
return;
|
|
1485
1488
|
}
|
|
@@ -1653,15 +1656,15 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
1653
1656
|
if (status === 'Complete' || status === 'Error') {
|
|
1654
1657
|
this.markMessageComplete(convoDetail);
|
|
1655
1658
|
}
|
|
1656
|
-
// Race condition guard: Before writing Error, reload from DB
|
|
1657
|
-
//
|
|
1658
|
-
//
|
|
1659
|
-
//
|
|
1660
|
-
//
|
|
1661
|
-
if (status === 'Error' && convoDetail.ID) {
|
|
1659
|
+
// Race condition guard: Before writing Error *or* In-Progress, reload from DB.
|
|
1660
|
+
// The In-Progress disconnect branch is the path that most needs this: a dropped
|
|
1661
|
+
// socket leaves the in-memory Status stale (still In-Progress from creation), and
|
|
1662
|
+
// without a reload we can overwrite a server Complete with the "still running"
|
|
1663
|
+
// placeholder. If the server already finished, emit that record and stop the timer.
|
|
1664
|
+
if ((status === 'Error' || status === 'In-Progress') && convoDetail.ID) {
|
|
1662
1665
|
await convoDetail.Load(convoDetail.ID);
|
|
1663
|
-
if (convoDetail.Status === 'Complete') {
|
|
1664
|
-
|
|
1666
|
+
if (convoDetail.Status === 'Complete' || convoDetail.Status === 'Error') {
|
|
1667
|
+
this.markMessageComplete(convoDetail);
|
|
1665
1668
|
this.messageSent.emit(convoDetail);
|
|
1666
1669
|
return;
|
|
1667
1670
|
}
|
|
@@ -1739,11 +1742,12 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
1739
1742
|
const agentName = payload.invokeAgent;
|
|
1740
1743
|
const reasoning = payload.reasoning || 'Delegating to specialist agent';
|
|
1741
1744
|
// Now create a NEW message for the sub-agent execution
|
|
1745
|
+
let agentResponseMessage = null;
|
|
1742
1746
|
try {
|
|
1743
1747
|
// Look up the agent to get its ID
|
|
1744
1748
|
const agent = AIEngineBase.Instance.Agents.find(a => a.Name === agentName);
|
|
1745
1749
|
// Create AI response message BEFORE invoking agent (for duration tracking)
|
|
1746
|
-
|
|
1750
|
+
agentResponseMessage = await this.dataCache.createConversationDetail(this.currentUser);
|
|
1747
1751
|
agentResponseMessage.ConversationID = conversationId;
|
|
1748
1752
|
agentResponseMessage.Role = 'AI';
|
|
1749
1753
|
agentResponseMessage.Message = '⏳ Starting...'; // Initial message
|
|
@@ -1798,6 +1802,12 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
1798
1802
|
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
1799
1803
|
}
|
|
1800
1804
|
else {
|
|
1805
|
+
// A post-ACK disconnect means the first run may still be executing on this
|
|
1806
|
+
// detail — do not start a second run on the same conversationDetailId.
|
|
1807
|
+
if (agentFailureDisposition(subResult).status === 'In-Progress') {
|
|
1808
|
+
await this.applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, subResult);
|
|
1809
|
+
return;
|
|
1810
|
+
}
|
|
1801
1811
|
// Sub-agent failed - attempt auto-retry once
|
|
1802
1812
|
console.log(`⚠️ ${agentName} failed, attempting auto-retry...`);
|
|
1803
1813
|
await this.updateConversationDetail(conversationManagerMessage, `👉 **${agentName}** will handle this request...\n\n⚠️ First attempt failed, retrying...`, conversationManagerMessage.Status);
|
|
@@ -1821,18 +1831,34 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
1821
1831
|
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
1822
1832
|
}
|
|
1823
1833
|
else {
|
|
1824
|
-
// Retry also failed
|
|
1825
|
-
|
|
1826
|
-
await this.
|
|
1827
|
-
|
|
1834
|
+
// Retry also failed — terminate the agent bubble (the red-pill timer lives here),
|
|
1835
|
+
// not only the Sage delegation message.
|
|
1836
|
+
await this.applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, retryResult, 'failed after retry');
|
|
1837
|
+
const retryDisposition = agentFailureDisposition(retryResult);
|
|
1838
|
+
if (retryDisposition.status === 'Error') {
|
|
1839
|
+
conversationManagerMessage.Error = retryDisposition.message;
|
|
1840
|
+
await this.updateConversationDetail(conversationManagerMessage, `❌ **${agentName}** failed after retry\n\n${retryDisposition.message}`, 'Error');
|
|
1841
|
+
}
|
|
1828
1842
|
}
|
|
1829
1843
|
}
|
|
1830
1844
|
}
|
|
1831
1845
|
catch (error) {
|
|
1832
1846
|
console.error(`❌ Error invoking sub-agent ${agentName}:`, error);
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1847
|
+
const catchResult = {
|
|
1848
|
+
success: false,
|
|
1849
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
1850
|
+
};
|
|
1851
|
+
if (agentResponseMessage) {
|
|
1852
|
+
await this.applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, catchResult);
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1855
|
+
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
1856
|
+
}
|
|
1857
|
+
const catchDisposition = agentFailureDisposition(catchResult);
|
|
1858
|
+
if (catchDisposition.status === 'Error') {
|
|
1859
|
+
conversationManagerMessage.Error = catchDisposition.message;
|
|
1860
|
+
await this.updateConversationDetail(conversationManagerMessage, `❌ **${agentName}** encountered an error\n\n${catchDisposition.message}`, 'Error');
|
|
1861
|
+
}
|
|
1836
1862
|
}
|
|
1837
1863
|
}
|
|
1838
1864
|
/**
|
|
@@ -1926,18 +1952,13 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
1926
1952
|
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
1927
1953
|
}
|
|
1928
1954
|
else {
|
|
1929
|
-
|
|
1930
|
-
statusMessage.Error = continuityResult?.agentRun?.ErrorMessage || null;
|
|
1931
|
-
await this.updateConversationDetail(statusMessage, `❌ **${agentName}** failed during refinement\n\n${continuityResult?.agentRun?.ErrorMessage || 'Unknown error'}`, 'Error');
|
|
1932
|
-
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
1955
|
+
await this.applyAgentFailureToDetail(statusMessage, userMessage, agentName, continuityResult, 'failed during refinement');
|
|
1933
1956
|
}
|
|
1934
1957
|
}
|
|
1935
1958
|
catch (error) {
|
|
1936
1959
|
console.error(`❌ Error in agent continuity with ${agentName}:`, error);
|
|
1937
1960
|
// Task removed in markMessageComplete() - this.activeTasks.remove(taskId);
|
|
1938
|
-
statusMessage
|
|
1939
|
-
await this.updateConversationDetail(statusMessage, `❌ **${agentName}** encountered an error\n\n${String(error)}`, 'Error');
|
|
1940
|
-
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
1961
|
+
await this.applyAgentFailureToDetail(statusMessage, userMessage, agentName, { success: false, errorMessage: error instanceof Error ? error.message : String(error) }, 'encountered an error');
|
|
1941
1962
|
}
|
|
1942
1963
|
}
|
|
1943
1964
|
/**
|
|
@@ -2020,21 +2041,17 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
2020
2041
|
}
|
|
2021
2042
|
}
|
|
2022
2043
|
else {
|
|
2023
|
-
|
|
2024
|
-
agentResponseMessage.Error = result?.agentRun?.ErrorMessage || null;
|
|
2025
|
-
await this.updateConversationDetail(agentResponseMessage, `❌ **@${agentName}** failed\n\n${result?.agentRun?.ErrorMessage || 'Unknown error'}`, 'Error');
|
|
2026
|
-
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2044
|
+
await this.applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, result);
|
|
2027
2045
|
}
|
|
2028
2046
|
}
|
|
2029
2047
|
catch (error) {
|
|
2030
2048
|
console.error(`❌ Error invoking mentioned agent ${agentName}:`, error);
|
|
2031
|
-
// Task removed in markMessageComplete() - this.activeTasks.remove(taskId);
|
|
2032
|
-
// Update the existing agent response message if it was created
|
|
2033
2049
|
if (agentResponseMessage) {
|
|
2034
|
-
agentResponseMessage
|
|
2035
|
-
|
|
2050
|
+
await this.applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, { success: false, errorMessage: error instanceof Error ? error.message : String(error) });
|
|
2051
|
+
}
|
|
2052
|
+
else {
|
|
2053
|
+
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2036
2054
|
}
|
|
2037
|
-
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2038
2055
|
}
|
|
2039
2056
|
}
|
|
2040
2057
|
/**
|
|
@@ -2176,21 +2193,17 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
2176
2193
|
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2177
2194
|
}
|
|
2178
2195
|
else {
|
|
2179
|
-
|
|
2180
|
-
agentResponseMessage.Error = result?.agentRun?.ErrorMessage || null;
|
|
2181
|
-
await this.updateConversationDetail(agentResponseMessage, `❌ **${agentName}** failed\n\n${result?.agentRun?.ErrorMessage || 'Unknown error'}`, 'Error');
|
|
2182
|
-
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2196
|
+
await this.applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, result);
|
|
2183
2197
|
}
|
|
2184
2198
|
}
|
|
2185
2199
|
catch (error) {
|
|
2186
2200
|
console.error(`❌ Error continuing with agent ${agentName}:`, error);
|
|
2187
|
-
// Task removed in markMessageComplete() - this.activeTasks.remove(taskId);
|
|
2188
|
-
// Update the existing agent response message if it was created
|
|
2189
2201
|
if (agentResponseMessage) {
|
|
2190
|
-
agentResponseMessage
|
|
2191
|
-
|
|
2202
|
+
await this.applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, { success: false, errorMessage: error instanceof Error ? error.message : String(error) });
|
|
2203
|
+
}
|
|
2204
|
+
else {
|
|
2205
|
+
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2192
2206
|
}
|
|
2193
|
-
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2194
2207
|
}
|
|
2195
2208
|
}
|
|
2196
2209
|
/**
|
|
@@ -2220,6 +2233,87 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
2220
2233
|
console.log(`✅ Conversation renamed to: "${result.Name}"`);
|
|
2221
2234
|
}
|
|
2222
2235
|
}
|
|
2236
|
+
/**
|
|
2237
|
+
* Persist an agent failure onto the response bubble.
|
|
2238
|
+
*
|
|
2239
|
+
* A dropped HTTP/WebSocket path used to return `null` from invokeSubAgent, so
|
|
2240
|
+
* the bubble said "Unknown error" while the AIAgentRun stayed Running and the
|
|
2241
|
+
* timer kept ticking. If the transport ACKed the mutation and then died, keep
|
|
2242
|
+
* In-Progress so a later completion event (or {@link startInFlightDetailWatch})
|
|
2243
|
+
* can land. ConversationDetail.Status is the server's claim; the client only
|
|
2244
|
+
* renders it. The GraphQLAIClient stall reconciler covers the wait inside
|
|
2245
|
+
* invokeSubAgent; once that returns, the watch observes the detail until the
|
|
2246
|
+
* server writes a terminal status (MaxTimePerRun).
|
|
2247
|
+
*
|
|
2248
|
+
* Always completes the user message — the user turn finished regardless of
|
|
2249
|
+
* what the agent is doing.
|
|
2250
|
+
*/
|
|
2251
|
+
async applyAgentFailureToDetail(agentResponseMessage, userMessage, agentName, result, failedVerb = 'failed') {
|
|
2252
|
+
const disposition = agentFailureDisposition(result);
|
|
2253
|
+
if (disposition.status === 'In-Progress') {
|
|
2254
|
+
await this.updateConversationDetail(agentResponseMessage, `⏳ **${agentName}** is still running on the server.\n\n${disposition.message}`, 'In-Progress');
|
|
2255
|
+
// Skip the watch if the reload-before-write guard already found a
|
|
2256
|
+
// terminal server status (Complete/Error) — starting it would race the
|
|
2257
|
+
// just-completed bubble.
|
|
2258
|
+
if (agentResponseMessage.Status === 'In-Progress') {
|
|
2259
|
+
this.startInFlightDetailWatch(agentResponseMessage);
|
|
2260
|
+
}
|
|
2261
|
+
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2262
|
+
return;
|
|
2263
|
+
}
|
|
2264
|
+
agentResponseMessage.Error = disposition.message;
|
|
2265
|
+
await this.updateConversationDetail(agentResponseMessage, `❌ **${agentName}** ${failedVerb}\n\n${disposition.message}`, 'Error');
|
|
2266
|
+
await this.updateConversationDetail(userMessage, userMessage.Message, 'Complete');
|
|
2267
|
+
}
|
|
2268
|
+
startInFlightDetailWatch(detail) {
|
|
2269
|
+
if (!detail.ID) {
|
|
2270
|
+
return;
|
|
2271
|
+
}
|
|
2272
|
+
this.stopInFlightDetailWatch(detail.ID);
|
|
2273
|
+
this.scheduleInFlightDetailPoll(detail, 0);
|
|
2274
|
+
}
|
|
2275
|
+
scheduleInFlightDetailPoll(detail, step) {
|
|
2276
|
+
const delays = MessageInputComponent.IN_FLIGHT_WATCH_BACKOFF_MS;
|
|
2277
|
+
const delay = delays[Math.min(step, delays.length - 1)];
|
|
2278
|
+
const handle = setTimeout(() => {
|
|
2279
|
+
void this.pollInFlightDetail(detail, step);
|
|
2280
|
+
}, delay);
|
|
2281
|
+
this.inFlightWatches.set(detail.ID, handle);
|
|
2282
|
+
}
|
|
2283
|
+
async pollInFlightDetail(detail, step) {
|
|
2284
|
+
if (!this.inFlightWatches.has(detail.ID)) {
|
|
2285
|
+
return;
|
|
2286
|
+
}
|
|
2287
|
+
try {
|
|
2288
|
+
await detail.Load(detail.ID);
|
|
2289
|
+
if (detail.Status === 'Complete' || detail.Status === 'Error') {
|
|
2290
|
+
this.stopInFlightDetailWatch(detail.ID);
|
|
2291
|
+
this.markMessageComplete(detail);
|
|
2292
|
+
this.messageSent.emit(detail);
|
|
2293
|
+
return;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
catch (e) {
|
|
2297
|
+
console.warn(`[InFlightWatch] Failed to reload conversation detail ${detail.ID}:`, e);
|
|
2298
|
+
}
|
|
2299
|
+
if (!this.inFlightWatches.has(detail.ID)) {
|
|
2300
|
+
return;
|
|
2301
|
+
}
|
|
2302
|
+
this.scheduleInFlightDetailPoll(detail, step + 1);
|
|
2303
|
+
}
|
|
2304
|
+
stopInFlightDetailWatch(detailId) {
|
|
2305
|
+
const handle = this.inFlightWatches.get(detailId);
|
|
2306
|
+
if (handle) {
|
|
2307
|
+
clearTimeout(handle);
|
|
2308
|
+
this.inFlightWatches.delete(detailId);
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
clearInFlightWatches() {
|
|
2312
|
+
for (const handle of this.inFlightWatches.values()) {
|
|
2313
|
+
clearTimeout(handle);
|
|
2314
|
+
}
|
|
2315
|
+
this.inFlightWatches.clear();
|
|
2316
|
+
}
|
|
2223
2317
|
/**
|
|
2224
2318
|
* Marks a conversation detail as complete and records timestamp to prevent race conditions
|
|
2225
2319
|
* Emits event to parent to refresh agent run data from database
|
|
@@ -2227,6 +2321,7 @@ export class MessageInputComponent extends BaseAngularComponent {
|
|
|
2227
2321
|
markMessageComplete(conversationDetail) {
|
|
2228
2322
|
const now = Date.now();
|
|
2229
2323
|
this.completionTimestamps.set(conversationDetail.ID, now);
|
|
2324
|
+
this.stopInFlightDetailWatch(conversationDetail.ID);
|
|
2230
2325
|
// Unregister streaming callback for this message (no more updates needed)
|
|
2231
2326
|
const callback = this.registeredCallbacks.get(conversationDetail.ID);
|
|
2232
2327
|
if (callback) {
|