mengw15 commented on code in PR #8586:
URL: https://github.com/apache/texera/pull/8586#discussion_r4050154304


##########
agent-service/src/server.ts:
##########
@@ -492,6 +496,14 @@ export function buildApp() {
 
             wsLog.info({ agentId, preview: msg.content.substring(0, 50) }, 
"received command");
 
+            // The prompt carries the workspace's current warehouse pick, so a 
run
+            // uses what the user has selected now rather than whatever was
+            // selected when the agent was created. An absent field IS the
+            // current selection — none — so it clears a previous pick rather
+            // than leaving a stale id to be sent (and refused while the 
feature
+            // is off) forever (#7751).
+            agent.setDelegateWarehouse(typeof msg.warehouseId === "number" ? 
msg.warehouseId : undefined);

Review Comment:
   Real race, but the premise doesn't hold: `sendMessage` has no serialization 
at all, and each call already overwrites `abortController` (so the first run 
can no longer be stopped), `currentMessageId`, `head`, the ReAct step list, and 
— through `refreshWorkflowFromBackend()` — the workflow content the first run 
is editing. Concurrent prompts are unsound well before the warehouse matters, 
so snapshotting it per run would only make that scenario look safe. The fix is 
to serialize prompts, which needs care around the `feedback` message path (sent 
from the interaction panel, plausibly while the agent is generating), so it 
doesn't belong in this PR's tail.



##########
agent-service/src/agent/tools/workflow-execution-tools.ts:
##########
@@ -272,6 +275,7 @@ async function executeWorkflowHttp(
     maxOperatorResultCharLimit: config.maxOperatorResultCharLimit ?? 
DEFAULT_AGENT_SETTINGS.maxOperatorResultCharLimit,
     maxOperatorResultCellCharLimit:
       config.maxOperatorResultCellCharLimit ?? 
DEFAULT_AGENT_SETTINGS.maxOperatorResultCellCharLimit,
+    ...(config.warehouseId !== undefined ? { warehouseId: config.warehouseId } 
: {}),

Review Comment:
   Good catch — that was the one hop with no coverage, and it is exactly where 
the chain broke last time. Added request-body tests for both cases (picked 
warehouse present, omitted field absent), and verified by deleting the spread 
you named: the new test goes red.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to