fix(workflows): callees of a test run inherit the test source

This commit is contained in:
sam committed 2026-10-13 12:46:48 +11:00
1 parent 2a066f6d4f
commit 25face6d04
4 files changed
+10 -6

No files matched your search

@@ -36,7 +36,8 @@ SELECT
caller.owner,
caller.repo,
number.last_number,
$2, $3, 'chat', $4, 'chat', $5,
$2, $3, 'chat', $4,
CASE WHEN caller.source = 'test' THEN 'test' ELSE 'chat' END, $5,
caller.org_id, caller.workspace_id, $6,
caller.id, caller.call_depth + 1, $7
FROM caller, number
@@ -69,7 +70,8 @@ type EnqueueCallTaskParams struct {
// InsertChatTask. The callee is started by the identity the caller's
// workflow declares, read from its pinned definition: a callee never inherits the
// identity that started its caller, and runs as the one its own workflow
// declares.
// declares. A callee of a test run is a test run too, so it cannot write to a
// forge either.
func (q *Queries) EnqueueCallTask(ctx context.Context, arg EnqueueCallTaskParams) (Task, error) {
row := q.db.QueryRow(ctx, enqueueCallTask,
arg.ID,
@@ -11,7 +11,8 @@
-- InsertChatTask. The callee is started by the identity the caller's
-- workflow declares, read from its pinned definition: a callee never inherits the
-- identity that started its caller, and runs as the one its own workflow
-- declares.
-- declares. A callee of a test run is a test run too, so it cannot write to a
-- forge either.
WITH caller AS (
SELECT t.* FROM tasks t WHERE t.id = $1 FOR UPDATE
), number AS (
@@ -25,7 +26,8 @@ SELECT
caller.owner,
caller.repo,
number.last_number,
sqlc.arg(title), sqlc.arg(body), 'chat', sqlc.arg(workflow), 'chat', sqlc.arg(identity),
sqlc.arg(title), sqlc.arg(body), 'chat', sqlc.arg(workflow),
CASE WHEN caller.source = 'test' THEN 'test' ELSE 'chat' END, sqlc.arg(identity),
caller.org_id, caller.workspace_id, sqlc.arg(inputs),
caller.id, caller.call_depth + 1, sqlc.arg('call_key')
FROM caller, number