Merge branch 'codex/simp-unify-agent-session-id' into codex/simp-ui-identity-residue
This commit is contained in:
@@ -377,7 +377,7 @@ export class AgentLoop extends Service implements AgentFactory {
|
|||||||
static Config = z.object({
|
static Config = z.object({
|
||||||
agents: z.array(z.object({
|
agents: z.array(z.object({
|
||||||
id: z.string().required(),
|
id: z.string().required(),
|
||||||
sessionId: z.string(),
|
sessionId: z.string().min(1),
|
||||||
model: z.string(),
|
model: z.string(),
|
||||||
cwd: z.string(),
|
cwd: z.string(),
|
||||||
resumeSessionId: z.string(),
|
resumeSessionId: z.string(),
|
||||||
|
|||||||
@@ -35,6 +35,15 @@ async function makeCoreContext(): Promise<Context> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe('config-driven session id', () => {
|
describe('config-driven session id', () => {
|
||||||
|
it('rejects an empty exact id before publishing an agent', async () => {
|
||||||
|
const ctx = await makeCoreContext()
|
||||||
|
await expect(ctx.plugin(AgentLoop, {
|
||||||
|
agents: [{ id: 'main', sessionId: SessionId(''), model: 'mock' }],
|
||||||
|
})).rejects.toThrow('expected string length >= 1')
|
||||||
|
expect(ctx.agents.get(SessionId(''))).toBeUndefined()
|
||||||
|
await ctx.fiber.dispose()
|
||||||
|
})
|
||||||
|
|
||||||
it('accepts one exact fresh id and rejects it alongside a resume id', async () => {
|
it('accepts one exact fresh id and rejects it alongside a resume id', async () => {
|
||||||
const exact = await makeCoreContext()
|
const exact = await makeCoreContext()
|
||||||
await exact.plugin(AgentLoop, {
|
await exact.plugin(AgentLoop, {
|
||||||
|
|||||||
Reference in New Issue
Block a user