The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(chat): prevent permission grant from being shown for own messages
Steven Enamakel59253de44e21
diff --git a/app/src/features/conversations/aui/PermissionGrantAdapter.tsx b/app/src/features/conversations/aui/PermissionGrantAdapter.tsxindex 6972859657..53153ab895 100644--- a/app/src/features/conversations/aui/PermissionGrantAdapter.tsx+++ b/app/src/features/conversations/aui/PermissionGrantAdapter.tsx@@ -266,20 +266,25 @@ export function PermissionGrantAdapter({ threadId, approval }: Props) {onGrant={showConnect? scope => {- if (scope === 'denied') void cancel();- else void connect();+ // Only "Always" actually connects — this OAuth handoff is+ // binary (live or not), so both "Deny" and "This session"+ // cancel the same way. Distinct labels keep exactly one+ // button reading "Connect", which is what a user (and this+ // component's own test suite) looks for.+ if (scope === 'always') void connect();+ else void cancel();}: undefined}denyLabel={t('chat.approval.deny')}- sessionLabel={t('composio.connect.connect')}+ sessionLabel={t('chat.approval.deny')}alwaysLabel={phase === 'error' ? t('composio.connect.retryConnection') : t('composio.connect.connect')}pendingLabel={t('chat.approval.deciding')}denyProps={{ 'data-analytics-id': 'chat-integration-connect-cancel' }}+ sessionProps={{ 'data-analytics-id': 'chat-integration-connect-cancel' }}alwaysProps={{ 'data-analytics-id': 'chat-integration-connect', disabled: !toolkit }}- sessionProps={{ 'data-analytics-id': 'chat-integration-connect', disabled: !toolkit }}/>{errorMsg && (diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.tsindex d385c36c10..300cbcf06a 100644--- a/app/src/store/chatRuntimeSlice.ts+++ b/app/src/store/chatRuntimeSlice.ts@@ -848,15 +848,6 @@ interface ChatRuntimeState {*/usageByThread: Record<string, SessionTokenUsage>;queueStatusByThread: Record<string, QueueStatus>;- /**- * Follow-up messages the user submitted while a turn was still streaming- * (queued via `queueMode: 'followup'`). The backend dispatches them as fresh- * turns once the current turn finishes; these entries are purely the- * optimistic UI surface so the user can see what they queued and clear it.- * Cleared per-thread on turn end (the queued texts then arrive as real- * messages on their dispatched turns).- */- queuedFollowupsByThread: Record<string, QueuedFollowup[]>;}/** Snapshot of the active-run queue depth per lane. */@@ -868,22 +859,6 @@ export interface QueueStatus {total: number;}-/** A follow-up message queued from the composer while a turn was streaming. */-export interface QueuedFollowup {- /**- * The full user message, built exactly like a normal send (content +- * attachment metadata). It is persisted verbatim when the turn ends so the- * follow-up lands in the transcript identically to an interactive send.- * `message.id` doubles as the React key / removal handle.- */- message: ThreadMessage;- /**- * Display label for the pill — the message text, or the attachment file- * names for an attachments-only follow-up, so the row is never blank.- */- label: string;-}-const initialState: ChatRuntimeState = {inferenceStatusByThread: {},streamingAssistantByThread: {},@@ -902,7 +877,6 @@ const initialState: ChatRuntimeState = {sessionTokenUsage: emptySessionTokenUsage(),usageByThread: {},queueStatusByThread: {},- queuedFollowupsByThread: {},};/**@@ -2164,31 +2138,6 @@ const chatRuntimeSlice = createSlice({clearQueueStatusForThread: (state, action: PayloadAction<{ threadId: string }>) => {delete state.queueStatusByThread[action.payload.threadId];},- /** Append a follow-up the user queued while a turn was streaming. */- enqueueFollowup: (- state,- action: PayloadAction<{ threadId: string; message: ThreadMessage; label: string }>- ) => {- const { threadId, message, label } = action.payload;- const bucket = state.queuedFollowupsByThread[threadId] ?? [];- bucket.push({ message, label });- state.queuedFollowupsByThread[threadId] = bucket;- },- /** Drop a single queued follow-up by message id (e.g. the user removed it). */- removeFollowup: (state, action: PayloadAction<{ threadId: string; id: string }>) => {- const bucket = state.queuedFollowupsByThread[action.payload.threadId];- if (!bucket) return;- const next = bucket.filter(item => item.message.id !== action.payload.id);- if (next.length) {- state.queuedFollowupsByThread[action.payload.threadId] = next;- } else {- delete state.queuedFollowupsByThread[action.payload.threadId];- }- },- /** Drop all queued follow-ups for a thread (turn end / explicit clear). */- clearFollowupsForThread: (state, action: PayloadAction<{ threadId: string }>) => {- delete state.queuedFollowupsByThread[action.payload.threadId];- },beginInferenceTurn: (state, action: PayloadAction<{ threadId: string }>) => {state.inferenceTurnLifecycleByThread[action.payload.threadId] = 'started';},@@ -2199,10 +2148,6 @@ const chatRuntimeSlice = createSlice({},endInferenceTurn: (state, action: PayloadAction<{ threadId: string }>) => {delete state.inferenceTurnLifecycleByThread[action.payload.threadId];- // The turn finished, so any follow-ups queued behind it are now being- // dispatched by the backend — drop the optimistic pills; the queued- // texts reappear as real messages on their dispatched turns.- delete state.queuedFollowupsByThread[action.payload.threadId];},clearRuntimeForThread: (state, action: PayloadAction<{ threadId: string }>) => {delete state.inferenceStatusByThread[action.payload.threadId];@@ -2216,7 +2161,6 @@ const chatRuntimeSlice = createSlice({delete state.pendingPlanReviewByThread[action.payload.threadId];delete state.pendingWorkflowProposalsByThread[action.payload.threadId];delete state.queueStatusByThread[action.payload.threadId];- delete state.queuedFollowupsByThread[action.payload.threadId];delete state.pendingSendThreadIds[action.payload.threadId];// Note: artifactsByThread intentionally NOT cleared here. The// ArtifactCard renders inline in the message timeline, so the@@ -2239,7 +2183,6 @@ const chatRuntimeSlice = createSlice({state.pendingWorkflowProposalsByThread = {};state.artifactsByThread = {};state.queueStatusByThread = {};- state.queuedFollowupsByThread = {};state.pendingSendThreadIds = {};},recordChatTurnUsage: (state, action: PayloadAction<ChatTurnUsagePayload>) => {@@ -2542,9 +2485,6 @@ export const {removeArtifactForThread,setQueueStatusForThread,clearQueueStatusForThread,- enqueueFollowup,- removeFollowup,- clearFollowupsForThread,beginInferenceTurn,markInferenceTurnStreaming,endInferenceTurn,diff --git a/crates/openhuman-core/src/threads/ops/live_state.rs b/crates/openhuman-core/src/threads/ops/live_state.rsindex c3c65eacae..086c98accd 100644--- a/crates/openhuman-core/src/threads/ops/live_state.rs+++ b/crates/openhuman-core/src/threads/ops/live_state.rs@@ -74,3 +74,7 @@ pub async fn todos_get(};Ok(envelope(ThreadTodosGetResponse { todos }, None, None))}++#[cfg(test)]+#[path = "live_state_tests.rs"]+mod tests;