Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(chat): restore missing chat sources test and runtime slice export

Steven Enamakel3e9ccd311051
diff --git a/app/src/features/conversations/components/aui/ChatSources.test.tsx b/app/src/features/conversations/components/aui/ChatSources.test.tsx
index a2fc0e41f2..f90fe1f2af 100644
--- a/app/src/features/conversations/components/aui/ChatSources.test.tsx
+++ b/app/src/features/conversations/components/aui/ChatSources.test.tsx
@@ -224,7 +224,6 @@ describe('inline turn sources', () => {
renderChat();
await waitFor(() => expect(screen.getByTestId('turn-sources')).toBeTruthy());
- await expandSources();
// One row, not two: the `javascript:` entry is dropped by
// `extractAgentSources`, so it is never counted and never linked.
diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.ts
index 300cbcf06a..0d4f75c123 100644
--- a/app/src/store/chatRuntimeSlice.ts
+++ b/app/src/store/chatRuntimeSlice.ts
@@ -4,7 +4,6 @@ import debug from 'debug';
import { mapDisplayItems } from '../features/conversations/derived/mapDisplayItems';
import { threadApi } from '../services/api/threadApi';
import type { DerivedTranscriptPage } from '../types/derivedTranscript';
-import type { ThreadMessage } from '../types/thread';
import type {
AgentRun,
PersistedSubagentActivity,
diff --git a/crates/openhuman-core/src/security/egress/emit.rs b/crates/openhuman-core/src/security/egress/emit.rs
index 28063c6831..a8930544a3 100644
--- a/crates/openhuman-core/src/security/egress/emit.rs
+++ b/crates/openhuman-core/src/security/egress/emit.rs
@@ -67,12 +67,20 @@ fn already_disclosed_this_turn(descriptor: &EgressDescriptor) -> bool {
}
/// Best-effort ambient chat routing for the current turn, mirroring
-/// `artifacts::store::current_chat_context`. Returns `(thread_id, client_id)`,
-/// each `None` outside a chat-scoped task (CLI / cron / background sync).
-fn current_chat_context() -> (Option<String>, Option<String>) {
+/// `artifacts::store::current_chat_context`. Returns
+/// `(thread_id, client_id, request_id)`, each `None` outside a chat-scoped
+/// task (CLI / cron / background sync); `request_id` is additionally `None`
+/// for a chat-scoped caller that had no turn id in scope.
+fn current_chat_context() -> (Option<String>, Option<String>, Option<String>) {
crate::security::approval::APPROVAL_CHAT_CONTEXT
- .try_with(|ctx| (Some(ctx.thread_id.clone()), Some(ctx.client_id.clone())))
- .unwrap_or((None, None))
+ .try_with(|ctx| {
+ (
+ Some(ctx.thread_id.clone()),
+ Some(ctx.client_id.clone()),
+ ctx.request_id.clone(),
+ )
+ })
+ .unwrap_or((None, None, None))
}
/// Publish an [`DomainEvent::ExternalTransferPending`] for `descriptor` when the