Skip to content

Commit 978e26f

Browse files
committed
fix(chat): narrow a disposition read by its status
1 parent 61b9fbd commit 978e26f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • apps/sim/lib/mothership/request/session

‎apps/sim/lib/mothership/request/session/steer.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ async function failureCode(response: Response): Promise<string | undefined> {
155155
* contract), which can only be answered by re-sending the message.
156156
*/
157157
type SteeringDispositionRead =
158-
| { status: 'queued' | 'not_applied' | 'unknown' }
158+
| { status: 'queued' }
159+
| { status: 'not_applied' }
160+
| { status: 'unknown' }
159161
| { status: 'applied'; eventSeq?: number; textOffset?: number }
160162
| { status: 'unsupported' }
161163

@@ -197,7 +199,7 @@ export async function requestSteeringDisposition(params: {
197199
return { status: 'unsupported' }
198200
}
199201
const { steeringId: _, ...disposition } = parsed.data
200-
return disposition
202+
return disposition.status === 'applied' ? disposition : { status: disposition.status }
201203
}
202204
if (code === 'steering_target_missing') return { status: 'not_applied' }
203205
if ((response.status === 404 || response.status === 405) && !code) {

0 commit comments

Comments
 (0)