mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-18 03:27:08 +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:
@@ -483,7 +483,7 @@ export class ApiClient {
|
||||
|
||||
async updateTeam(
|
||||
teamId: string,
|
||||
body: { name?: string; status?: 'active' | 'archived' }
|
||||
body: { name?: string; status?: 'active' | 'archived'; leadSessionId?: string | null }
|
||||
): Promise<{ team: TeamSummary }> {
|
||||
return await this.request<{ team: TeamSummary }>(
|
||||
`/api/teams/${encodeURIComponent(teamId)}`,
|
||||
@@ -1117,7 +1117,8 @@ export class ApiClient {
|
||||
serviceTier?: 'fast' | 'standard',
|
||||
collaborationMode?: CodexCollaborationMode,
|
||||
copilotAgentMode?: CopilotAgentMode,
|
||||
startingMode?: 'remote' | 'pty'
|
||||
startingMode?: 'remote' | 'pty',
|
||||
team?: { id: string; name: string; role: string }
|
||||
): Promise<SpawnResponse> {
|
||||
return await this.request<SpawnResponse>(`/api/machines/${encodeURIComponent(machineId)}/spawn`, {
|
||||
method: 'POST',
|
||||
@@ -1134,7 +1135,8 @@ export class ApiClient {
|
||||
serviceTier,
|
||||
collaborationMode,
|
||||
copilotAgentMode,
|
||||
startingMode
|
||||
startingMode,
|
||||
...(team ? { team } : {})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user