mirror of
https://github.com/bdnugget/rs-sdk.git
synced 2026-11-07 09:07:30 +00:00
chore(bot): stop sending the unused formattedState with each state frame
The browser bot attached a text rendering of the world state (formatWorldStateForAgent) to every state message. Nothing reads it: the gateway forwards only message.state, and the SDK, MCP server and lite runner never refer to it. Dropping it trims ~5% of each browser bot frame (~10% after compression). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f749a8b9b
commit
a132676216
3 files changed
+4
-7
No files matched your search
@@ -13,7 +13,6 @@ import type { BotWorldState, BotAction, ActionResult } from '../../sdk/types';
|
||||
export interface BotClientMessage {
|
||||
type: 'state' | 'actionResult' | 'setGoal' | 'connected' | 'screenshot_response';
|
||||
state?: BotWorldState;
|
||||
formattedState?: string;
|
||||
result?: ActionResult;
|
||||
actionId?: string; // Echo back for correlation
|
||||
goal?: string;
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Client } from '#/client/Client.js';
|
||||
import type { BotState, BotAction, BotWorldState } from './types.js';
|
||||
import { BotStateCollector } from './StateCollector.js';
|
||||
import { ActionExecutor, formatAction } from './ActionExecutor.js';
|
||||
import { formatBotState, formatWorldStateForAgent } from './formatters.js';
|
||||
import { formatBotState } from './formatters.js';
|
||||
import { GatewayConnection, type GatewayMessageHandler } from './GatewayConnection.js';
|
||||
import { OverlayUI } from './OverlayUI.js';
|
||||
import { BotActionQueue, type QueuedBotAction } from './ActionQueue.js';
|
||||
@@ -307,8 +307,7 @@ export class BotOverlay implements GatewayMessageHandler {
|
||||
const state = this.collectWorldState();
|
||||
if (!state) return;
|
||||
|
||||
const formattedState = formatWorldStateForAgent(state, 'SDK Control');
|
||||
this.gateway.sendState(state, formattedState);
|
||||
this.gateway.sendState(state);
|
||||
}
|
||||
|
||||
private finishAction(entry: QueuedBotAction, result: ActionResult): void {
|
||||
|
||||
@@ -148,12 +148,11 @@ export class GatewayConnection {
|
||||
}
|
||||
}
|
||||
|
||||
sendState(state: BotWorldState, formattedState: string): void {
|
||||
sendState(state: BotWorldState): void {
|
||||
if (!this.connected) return;
|
||||
this.send({
|
||||
type: 'state',
|
||||
state,
|
||||
formattedState
|
||||
state
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user