test(goal): disarm the seeded goal in the Loader e2e
The goal domain e2e runs over the shipped headless profile, whose base bundle mounts goal-round-driver. GoalService.create() arms the goal the fixture seeds, so the driver queued round 1 when the task turn went idle and the test's headless driver disposed the context mid-round. The assertions held only while the aborted round's turn/end missed the log before disposal; an extra await in the agent loop's pre-step path (#6024) let it land and the test failed deterministically. Disarm the goal right after creating it. Activation is process-local, so the persisted goal/change snapshot is unchanged and the driver starts no round. Also assert a single turn/start, which records a started round even when disposal aborts it before its turn/end is persisted.
This commit is contained in:
1 parent
58c8cef7dc
commit
63e99ee2bf
2 files changed
+6
-1
No files matched your search
+5
-1
@@ -1,4 +1,4 @@
|
||||
/** Test-only Loader plugin that creates a goal at the first real step edge. */
|
||||
/** Test-only Loader plugin that creates a disarmed goal at the first real step edge. */
|
||||
|
||||
import type { Context } from '@deepseek-ai/cordis'
|
||||
import type {} from '@deepseek-ai/dsh-goal'
|
||||
@@ -13,6 +13,10 @@ export function apply(ctx: Context): void {
|
||||
objective: 'Prove the composed goal survives in the session log',
|
||||
maxGoalRounds: 7,
|
||||
})
|
||||
// An armed goal makes the shipped goal-round-driver start a round at
|
||||
// idle, racing the test driver's disposal. Activation is process-local,
|
||||
// so disarming leaves the persisted snapshot unchanged.
|
||||
ctx.goals.disarm(agent)
|
||||
}
|
||||
return next()
|
||||
})
|
||||
|
||||
@@ -48,6 +48,7 @@ describe('goal domain through the production headless profile and process', () =
|
||||
})
|
||||
expect(result['output']).toBeTypeOf('string')
|
||||
expect(result['output']).toContain('CLI tool round trip complete')
|
||||
expect(events.filter(event => event.type === 'turn/start')).toHaveLength(1)
|
||||
expect(events.filter(event => event.type === 'turn/end')).toHaveLength(1)
|
||||
|
||||
const changes = events.filter(event => event.type === 'goal/change')
|
||||
|
||||
Reference in new issue
Block a user