mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
fix(apiproxy): derive queued steering on the client, drop it from the wire
The session/queued frame no longer carries steering — AgentMessage no longer has the field. The client derives it from the same ordered turn boundaries the host saw (a frame arriving while a turn is open joined the steering FIFO).
This commit is contained in:
@@ -105,6 +105,11 @@ export class Session implements ObservableSnapshot<ConversationSnapshot> {
|
||||
private dispatchesRev = 0
|
||||
private dispatchesCache: { rev: number; value: ReadonlyMap<string, readonly CodeSubCall[]> } | null = null
|
||||
private running = false
|
||||
/** Whether a turn is open on the live stream — set on turn/start, cleared on
|
||||
* turn/end. A session/queued frame arriving while this is true joined the
|
||||
* steering FIFO; the host no longer stamps steering on the frame, so the
|
||||
* client derives it from the same ordered turn boundaries the host saw. */
|
||||
private turnOpen = false
|
||||
/**
|
||||
* Sticky send marker, private input of the composerPhase derivation: set
|
||||
* synchronously before prompt()'s first await, never reset — the blank →
|
||||
@@ -334,6 +339,12 @@ export class Session implements ObservableSnapshot<ConversationSnapshot> {
|
||||
switch (frame.type) {
|
||||
case 'session/event': {
|
||||
this.retireQueued(frame.event)
|
||||
// Track turn-open state AFTER retirement (a message turn/start first
|
||||
// claims its queued entry, then opens the turn), so a later queued
|
||||
// frame is stamped steering iff a turn is open — the host no longer
|
||||
// stamps it on the frame.
|
||||
if (frame.event.type === 'turn/start') this.turnOpen = true
|
||||
else if (frame.event.type === 'turn/end') this.turnOpen = false
|
||||
this.acceptLiveEvent(frame.event, frame.view)
|
||||
return
|
||||
}
|
||||
@@ -343,7 +354,7 @@ export class Session implements ObservableSnapshot<ConversationSnapshot> {
|
||||
const key = 'rpcId' in frame.source ? String(frame.source.rpcId) : `f:${rpcId}`
|
||||
this.queued.push({
|
||||
row: { key, preview: queuePreviewOf(frame.content) },
|
||||
steering: frame.steering,
|
||||
steering: this.turnOpen,
|
||||
sourceJson: JSON.stringify(frame.source),
|
||||
})
|
||||
this.queueRev++
|
||||
|
||||
Reference in New Issue
Block a user