feat: claude agent teams UI support #1145
ClosedJustYannicc(GitHub profile, opens in a new tab)wants to merge 11 commits into
main fromrefs/pull/1145/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
- @@ -0,0 +2154,21 @@2154+ },2155+ createdAt: startedAt,2156+ updatedAt: startedAt,2157+ };2158+2159+ const context: ClaudeSessionContext = {2160+ session,2161+ promptQueue,2162+ query: queryRuntime,2163+ startedAt,2164+ resumeSessionId: resumeState?.resume,2165+ pendingApprovals,2166+ turns: [],2167+ inFlightTools,2168+ turnState: undefined,2169+ lastAssistantUuid: resumeState?.resumeSessionAt,2170+ lastThreadStartedId: undefined,2171+ stopped: false,2172+ };2173+ yield* Ref.set(contextRef, context);2174+ sessions.set(threadId, context);@@ -0,0 +162,21 @@162+ const parsed = Date.parse(value);163+ if (Number.isNaN(parsed)) {164+ return value;165+ }166+ return new Intl.DateTimeFormat(undefined, {167+ month: "short",168+ day: "numeric",169+ hour: "numeric",170+ minute: "2-digit",171+ }).format(parsed);172+}173+174+function formatRelativeTime(iso: string): string {175+ const diff = Date.now() - new Date(iso).getTime();176+ const minutes = Math.floor(diff / 60_000);177+ if (minutes < 1) return "just now";178+ if (minutes < 60) return `${minutes}m ago`;179+ const hours = Math.floor(minutes / 60);180+ if (hours < 24) return `${hours}h ago`;181+ return `${Math.floor(hours / 24)}d ago`;182+}@@ -0,0 +261,21 @@261+ const agentColor =262+ asTrimmedString(value?.agent_color) ??263+ asTrimmedString(value?.agentColor) ??264+ asTrimmedString(265+ value?.routing && typeof value.routing === "object"266+ ? (value.routing as Record<string, unknown>).senderColor267+ : undefined,268+ );269+ const agentType = asTrimmedString(value?.agent_type) ?? asTrimmedString(value?.agentType);270+ const teamName = asTrimmedString(value?.team_name) ?? asTrimmedString(value?.teamName);271+ const teammateName =272+ asTrimmedString(value?.teammate_name) ?? asTrimmedString(value?.teammateName);273+ const parentSessionId =274+ asTrimmedString(value?.parent_session_id) ?? asTrimmedString(value?.parentSessionId);275+ const teammateMode =276+ asTrimmedString(value?.teammate_mode) ?? asTrimmedString(value?.teammateMode);277+ const toolUseId = asTrimmedString(value?.tool_use_id) ?? asTrimmedString(value?.toolUseId);278+ const planModeRequired =279+ asBoolean(value?.plan_mode_required) ?? asBoolean(value?.planModeRequired);280+ const awaitingLeaderApproval =281+ asBoolean(value?.awaitingLeaderApproval) ?? asBoolean(value?.awaiting_leader_approval);@@ -607,0 +925,21 @@925+ ? { statusSource: asTrimmedString(payload?.statusSource)! }926+ : existing?.statusSource927+ ? { statusSource: existing.statusSource }928+ : {}),929+ ...(asTrimmedString(payload?.teamName)930+ ? { teamName: asTrimmedString(payload?.teamName)! }931+ : existing?.teamName932+ ? { teamName: existing.teamName }933+ : {}),934+ ...(asTrimmedString(payload?.teammateMode)935+ ? { teammateMode: asTrimmedString(payload?.teammateMode)! }936+ : existing?.teammateMode937+ ? { teammateMode: existing.teammateMode }938+ : {}),939+ ...(members && members.length > 0 ? { members } : {}),940+ ...(tasks && tasks.length > 0 ? { tasks } : {}),941+ };942+ byRunId.set(runId, snapshot);943+ if (teamKey) {944+ byTeamKey.set(teamKey, snapshot);945+ }@@ -0,0 +396,21 @@396+ ) {397+ return "command_execution";398+ }399+ if (400+ normalized.includes("edit") ||401+ normalized.includes("write") ||402+ normalized.includes("file") ||403+ normalized.includes("patch") ||404+ normalized.includes("replace") ||405+ normalized.includes("create") ||406+ normalized.includes("delete")407+ ) {408+ return "file_change";409+ }410+ if (normalized.includes("mcp")) {411+ return "mcp_tool_call";412+ }413+ return "dynamic_tool_call";414+}415+416+function classifyRequestType(toolName: string): CanonicalRequestType {@@ -392,0 +599,21 @@599+ provider: CLAUDE_PROVIDER,600+ status: "error" as const,601+ available: false,602+ authStatus: "unknown" as const,603+ checkedAt,604+ ...(parsedVersion ? { version: parsedVersion } : {}),605+ message: detail606+ ? `Claude Code runtime is installed but failed to run. ${detail}`607+ : "Claude Code runtime is installed but failed to run.",608+ capabilities: {609+ agentTeams: buildClaudeAgentTeamsCapability(parsedVersion),610+ },611+ };612+ }613+614+ const authProbe = yield* runClaudeCommand(["auth", "status", "--json"]).pipe(615+ Effect.timeoutOption(DEFAULT_TIMEOUT_MS),616+ Effect.result,617+ );618+619+ if (Result.isFailure(authProbe)) {@@ -26,3 +28,10 @@26282729 const DEFAULT_TIMEOUT_MS = 4_000;2830 const CODEX_PROVIDER = "codex" as const;31+const CLAUDE_PROVIDER = "claudeCode" as const;32+const MIN_CLAUDE_AGENT_TEAMS_VERSION = "2.1.32";33+const require = createRequire(import.meta.url);34+export const CLAUDE_CLI_PATH = path.join(35+ path.dirname(require.resolve("@anthropic-ai/claude-agent-sdk")),36+ "cli.js",37+);
JustYannicc(GitHub profile, opens in a new tab) closed this
JustYannicc(GitHub profile, opens in a new tab) reopened this
maria-rcks assignedJustYannicc
juliusmarminge closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
bebf225d-2380-468d-9ff9-d278f15f6828You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Tip
You can disable sequence diagrams in the walkthrough.
Disable the
reviews.sequence_diagramssetting to disable sequence diagrams in the walkthrough.