mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-29 06:13:46 +00:00
fix(hub,cli,web): give web-created team sessions their team context at spawn
Root cause of 'lead never answers': sessions created through the web form never received HAPI_TEAM_* env, so their system prompts had no team rules (only spawn_peer-created members did). Now: - /api/machines/:id/spawn accepts a team descriptor; the runner exports the env as before - team mode creates the team first, spawns the lead with the team context, then attaches it as lead; member mode spawns with the team context before joining - OpenCode system prompts (title + native tool instruction) carry the team block too - human ping copy is action-first: reply directly (auto-synced to the group); do not run shell commands or explore the team
This commit is contained in:
@@ -823,7 +823,13 @@ export const SpawnSessionRequestSchema = z.object({
|
||||
serviceTier: z.enum(['fast', 'standard']).optional(),
|
||||
collaborationMode: CodexCollaborationModeSchema.optional(),
|
||||
copilotAgentMode: CopilotAgentModeSchema.optional(),
|
||||
startingMode: z.enum(['remote', 'pty']).optional()
|
||||
startingMode: z.enum(['remote', 'pty']).optional(),
|
||||
/** Agent Team context: runner exports HAPI_TEAM_* into the child CLI. */
|
||||
team: z.object({
|
||||
id: z.string().min(1),
|
||||
name: z.string(),
|
||||
role: z.string().min(1)
|
||||
}).optional()
|
||||
})
|
||||
|
||||
export type SpawnSessionRequest = z.infer<typeof SpawnSessionRequestSchema>
|
||||
|
||||
Reference in New Issue
Block a user