feat(PBI-67/ST-1299/T-788): wait_for_job retourneert config
Roept resolveJobConfig aan na het claimen van een job en voegt het resultaat toe als `config: JobConfig` aan de response payload. Werkt voor alle 3 return-paden (IDEA_*, SPRINT_IMPLEMENTATION, default TASK_IMPLEMENTATION). Schema-velden lokaal toegevoegd ter ondersteuning van het Prisma-include (preferred_*, requires_opus, requested_*, actual_thinking_tokens). De sync-schema.sh-flow refresht ze later vanuit het scrum4me-submodule zodra PBI-67/ST-1297 in main is. Pure additief — oude clients negeren `config` en blijven werken op Claude Code defaults uit ~/.claude/settings.json. 301 tests slagen onveranderd. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
070c039740
commit
e2963d58fb
2 changed files with 40 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ import { createWorktreeForJob } from '../git/worktree.js'
|
|||
import { getWorktreeRoot } from '../git/worktree-paths.js'
|
||||
import { setupProductWorktrees, releaseLocksOnTerminal } from '../git/job-locks.js'
|
||||
import { pushBranchForJob } from '../git/push.js'
|
||||
import { resolveJobConfig } from '../lib/job-config.js'
|
||||
|
||||
/** Parse `https://github.com/<owner>/<name>(.git)?` → `<name>`. */
|
||||
export function repoNameFromUrl(repoUrl: string | null | undefined): string | null {
|
||||
|
|
@ -467,11 +468,38 @@ async function getFullJobContext(jobId: string) {
|
|||
},
|
||||
},
|
||||
},
|
||||
product: { select: { id: true, name: true, repo_url: true, definition_of_done: true } },
|
||||
product: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
repo_url: true,
|
||||
definition_of_done: true,
|
||||
preferred_model: true,
|
||||
thinking_budget_default: true,
|
||||
preferred_permission_mode: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
if (!job) return null
|
||||
|
||||
// PBI-67: model + mode-selectie. Resolved op claim-moment; override-cascade
|
||||
// task.requires_opus → job.requested_* → product.preferred_* → kind-default.
|
||||
const config = resolveJobConfig(
|
||||
{
|
||||
kind: job.kind,
|
||||
requested_model: job.requested_model,
|
||||
requested_thinking_budget: job.requested_thinking_budget,
|
||||
requested_permission_mode: job.requested_permission_mode,
|
||||
},
|
||||
{
|
||||
preferred_model: job.product.preferred_model,
|
||||
thinking_budget_default: job.product.thinking_budget_default,
|
||||
preferred_permission_mode: job.product.preferred_permission_mode,
|
||||
},
|
||||
job.task ? { requires_opus: job.task.requires_opus } : undefined,
|
||||
)
|
||||
|
||||
// M12: branch on kind. Idea-jobs hebben geen task/story/pbi/sprint; ze
|
||||
// hebben in plaats daarvan idea + embedded prompt_text.
|
||||
if (job.kind === 'IDEA_GRILL' || job.kind === 'IDEA_MAKE_PLAN') {
|
||||
|
|
@ -515,6 +543,7 @@ async function getFullJobContext(jobId: string) {
|
|||
job_id: job.id,
|
||||
kind: job.kind,
|
||||
status: 'claimed',
|
||||
config,
|
||||
idea: {
|
||||
id: idea.id,
|
||||
code: idea.code,
|
||||
|
|
@ -659,6 +688,7 @@ async function getFullJobContext(jobId: string) {
|
|||
job_id: job.id,
|
||||
kind: job.kind,
|
||||
status: 'claimed',
|
||||
config,
|
||||
sprint: {
|
||||
id: sprintRun.sprint.id,
|
||||
sprint_goal: sprintRun.sprint.sprint_goal,
|
||||
|
|
@ -724,6 +754,7 @@ async function getFullJobContext(jobId: string) {
|
|||
job_id: job.id,
|
||||
kind: job.kind,
|
||||
status: 'claimed',
|
||||
config,
|
||||
task: {
|
||||
id: task.id,
|
||||
title: task.title,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue