Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): slash commands sent during a turn wait instead of steering #40316

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/40316/headmerged by juliusmarminge View on GitHub

Showing 19 changed files with 95 additions and 15 deletions (loading 16).

x
0 of 19 viewed, 19 left
24 additions and 0 deletionsapps/server/src/orchestration-v2/CommandPolicy.test.tsModified
View file
@@ -252,6 +252,30 @@
assert.isTrue(grok.turns.supportsActiveSteering);
});
​
+// regression: #32606 a slash command steered into a running turn replaced the task
+it.each([
+ ["/compact", { type: "queue_after_active" }],
+ ["/context", { type: "queue_after_active" }],
+ [" /context all\n", { type: "queue_after_active" }],
+ ["/plugin:review-pr 12", { type: "queue_after_active" }],
+ ["/home/me/x.ts fails", { type: "steer_active", targetRunId: activeRunId }],
+ ["/ context", { type: "steer_active", targetRunId: activeRunId }],
+ ["$skill /context", { type: "steer_active", targetRunId: activeRunId }],
+] as const)("steers %j only when it is not a slash command", (text, expected) => {
+ const projection = dispatchProjection(baseCapabilities);
+ for (const deliveryIntent of ["auto", "steer"] as const) {
+ assert.deepEqual(
+ CommandPolicy.resolveMessageDispatch(projection, {
+ dispatchMode: { type: "start_immediately" },
+ deliveryIntent,
+ text,
+ attachments: [],
+ }),
+ expected,
+ );
+ }
+});
+​
it.each(["/compact", " /LOGOUT "])("queues a steer sent while %s runs", (text) => {
const projection = dispatchProjection(baseCapabilities);