feat: Agent Teams improvements - SSE fix, team state parsing, and permission handling#298
Open
0x7551 wants to merge 1 commit intotiann:mainfrom
Open
feat: Agent Teams improvements - SSE fix, team state parsing, and permission handling#2980x7551 wants to merge 1 commit intotiann:mainfrom
0x7551 wants to merge 1 commit intotiann:mainfrom
Conversation
…mission handling - Replace Hono streamSSE with push-based ReadableStream to fix Bun SSE buffering delay - Enhance team state parsing: teammate messages, idle notifications, shutdown responses - Extract effective team name from TeamCreate results, normalize task IDs - Add --dangerously-skip-permissions for local teammate mode with deny rules for dangerous commands - Rewrite TeamPanel component with expandable member activity details - Add TeamCreate tool card rendering - Add comprehensive team parsing tests
| return { agentRequestId: teamPerm.requestId, teamPerm } | ||
| } | ||
| // Last resort: find by tool name match in agentState.requests | ||
| for (const [key, req] of Object.entries(requests ?? {})) { |
There was a problem hiding this comment.
[MAJOR] Tool-name fallback can approve/deny the wrong request if multiple pending requests share the same tool. The current loop returns the first match, which can misapply a decision to another request. hub/src/web/routes/permissions.ts:88
Suggested fix:
const matches = Object.entries(requests ?? {}).filter(
([, req]) => isObject(req) && req.tool === teamPerm.toolName
)
if (matches.length === 1) {
return { agentRequestId: matches[0][0], teamPerm }
}|
|
||
| const handleApprove = async () => { | ||
| setLoading(true) | ||
| setActed('approve') |
There was a problem hiding this comment.
[MINOR] UI marks the permission as allowed/denied before the async action succeeds, so failures still show success. web/src/components/TeamPanel.tsx:135
Suggested fix:
const handleApprove = async () => {
setLoading(true)
try {
await onApprove()
setActed('approve')
} finally {
setLoading(false)
}
}
const handleDeny = async () => {
setLoading(true)
try {
await onDeny()
setActed('deny')
} finally {
setLoading(false)
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebased on latest upstream/main. Replaces #295.
Based on #258's Agent Teams feature, this PR fixes and enhances team collaboration stability and UX.
SSE Delay Fix (Hub)
streamSSE(TransformStream/pull mode) with direct push-basedReadableStream, eliminating buffering delay under BunTeam State Parsing Enhancement (Hub)
<teammate-message>parsing: idle_notification, shutdown_response and other protocol messagesrunInBackground,isolationparametersagent:name@teamsuffixesTeam Member Permission Handling (CLI + Hub)
permission_requestis part of Claude's internal team protocol, handled by team lead agent via SendMessage, not external RPC approval--dangerously-skip-permissionsfor local mode to avoid terminal permission prompts blocking (HAPI has no interactive terminal)Web UI Enhancement
Other Fixes
resolveAgentRequestIdto permission routesTest plan
Note: The
AcpSdkBackend.test.tsfailure in CI is a pre-existing timing race condition unrelated to this PR (also fails on clean upstream/main locally).via HAPI