refactor: replace Task tool with Agent tool and fix schema compliance

## Task -> Agent Replacement
- Replace all Task({}) calls with Agent({}) across .claude/ directory
- Update allowed-tools declarations from Task to Agent
- Update documentation references from "Task tool" to "Agent tool"

## Schema Compliance Fixes

### Agent Schema
- Add missing required `description` parameter in 6 files
- Add missing `run_in_background: false` for subagent calls
- Add missing `subagent_type` parameter

### AskUserQuestion Schema
- Fix issue-manage/SKILL.md: reduce options from 5 to 4 (max allowed)

### SendMessage Schema
- Fix team-worker.md: use correct params (type, content, summary)
- Remove invalid `team_name` parameter

### TaskCreate/TaskUpdate Schema
- Remove invalid `blockedBy`, `owner`, `status` from TaskCreate calls
- Use separate TaskUpdate calls for dependencies and ownership
- Fix TaskUpdate syntax to use object parameter

### TeamDelete Schema
- Remove parameters from TeamDelete() calls (should be no params)

### TaskOutput Schema
- Fix Python-style syntax to JavaScript object syntax

## Files Changed
- 146 files updated across commands/, skills/, skills_lib/, agents/
This commit is contained in:
catlog22
2026-03-04 22:40:39 +08:00
parent 64e772f9b8
commit 16bbfcd12a
146 changed files with 505 additions and 516 deletions

View File

@@ -22,6 +22,15 @@ interface ChunkErrorBoundaryState {
* Error displayed when a chunk fails to load
*/
function ChunkLoadError({ error, onRetry }: { error: Error | null; onRetry: () => void }) {
const handleGoBack = () => {
// Try to go back in history, fallback to home if no history
if (window.history.length > 1) {
window.history.back();
} else {
window.location.href = '/';
}
};
return (
<div className="flex items-center justify-center h-full p-8">
<div className="text-center max-w-md">
@@ -46,11 +55,14 @@ function ChunkLoadError({ error, onRetry }: { error: Error | null; onRetry: () =
? 'A network error occurred while loading this page. Please check your connection and try again.'
: 'An error occurred while loading this page. Please try refreshing.'}
</p>
<div className="flex gap-3 justify-center">
<div className="flex gap-3 justify-center flex-wrap">
<Button onClick={onRetry} variant="default">
Try Again
</Button>
<Button onClick={() => window.location.href = '/'} variant="outline">
<Button onClick={handleGoBack} variant="outline">
Go Back
</Button>
<Button onClick={() => window.location.href = '/'} variant="ghost">
Go Home
</Button>
</div>

View File

@@ -47,6 +47,9 @@
"artifacts": "Artifacts",
"messages": "Messages"
},
"error": {
"loadFailed": "Failed to Load Team Data"
},
"artifacts": {
"title": "Team Artifacts",
"plan": "Plan",

View File

@@ -47,6 +47,9 @@
"artifacts": "产物",
"messages": "消息"
},
"error": {
"loadFailed": "加载团队数据失败"
},
"artifacts": {
"title": "团队产物",
"plan": "计划",

View File

@@ -3,10 +3,11 @@
// ========================================
// Main page for team execution - list/detail dual view with tabbed detail
import { useMemo } from 'react';
import { useMemo, useEffect } from 'react';
import { useIntl } from 'react-intl';
import { Package, MessageSquare, Maximize2, Minimize2, GitBranch } from 'lucide-react';
import { Package, MessageSquare, Maximize2, Minimize2, GitBranch, AlertTriangle } from 'lucide-react';
import { Card, CardContent } from '@/components/ui/Card';
import { Button } from '@/components/ui/Button';
import { cn } from '@/lib/utils';
import { useAppStore, selectIsImmersiveMode } from '@/stores/appStore';
import { TabsNavigation, type TabItem } from '@/components/ui/TabsNavigation';
@@ -43,7 +44,7 @@ export function TeamPage() {
const toggleImmersiveMode = useAppStore((s) => s.toggleImmersiveMode);
// Data hooks
const { teams } = useTeams(locationFilter);
const { teams, error: teamsError, isLoading: teamsLoading } = useTeams(locationFilter);
const { messages, total: messageTotal } = useTeamMessages(
viewMode === 'detail' ? selectedTeam : null,
messageFilter
@@ -58,6 +59,14 @@ export function TeamPage() {
[teams, selectedTeam]
);
// Auto-reset to list view when in detail mode but team data is missing after loading
useEffect(() => {
if (viewMode === 'detail' && selectedTeam && !teamsLoading && teams.length > 0 && !teamData) {
// Team no longer exists or is filtered out, return to list
backToList();
}
}, [viewMode, selectedTeam, teamsLoading, teams.length, teamData, backToList]);
// Derive dynamic pipeline stages and multi-phase info
const stages = useMemo(
() =>
@@ -77,6 +86,36 @@ export function TeamPage() {
[teamData?.role_state]
);
// Error state - show error page with back button when API fails
if (teamsError && viewMode === 'detail') {
return (
<div className="flex items-center justify-center min-h-[400px] p-8">
<div className="text-center max-w-md">
<div className="mb-4">
<AlertTriangle className="w-16 h-16 mx-auto text-destructive" />
</div>
<h2 className="text-xl font-semibold mb-2">
{formatMessage({ id: 'team.error.loadFailed' })}
</h2>
<p className="text-muted-foreground mb-6">
{teamsError instanceof Error ? teamsError.message : String(teamsError)}
</p>
<div className="flex gap-3 justify-center">
<Button onClick={backToList} variant="default">
{formatMessage({ id: 'team.detail.backToList' })}
</Button>
<Button
onClick={() => window.location.reload()}
variant="outline"
>
{formatMessage({ id: 'common.actions.retry' })}
</Button>
</div>
</div>
</div>
);
}
// List view (also fallback when selected team data is not available)
if (viewMode === 'list' || !selectedTeam || (viewMode === 'detail' && teams.length > 0 && !teamData)) {
return (