Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
def3617
docs: update contributors
2228293026 Apr 6, 2026
269b794
Merge branch 'claude-code-best:main' into main
2228293026 Apr 6, 2026
35d5207
Merge branch 'claude-code-best:main' into main
2228293026 Apr 7, 2026
4a18d0d
docs: update contributors
2228293026 Apr 7, 2026
1dccbd9
Merge branch 'claude-code-best:main' into main
2228293026 Apr 7, 2026
2771eee
docs: update contributors
2228293026 Apr 7, 2026
629371a
Merge branch 'claude-code-best:main' into main
2228293026 Apr 7, 2026
e01680c
Merge branch 'claude-code-best:main' into main
2228293026 Apr 7, 2026
b4a7cc2
Merge branch 'claude-code-best:main' into main
2228293026 Apr 7, 2026
d0b54de
docs: update contributors
2228293026 Apr 7, 2026
0d63f98
Merge branch 'claude-code-best:main' into main
2228293026 Apr 7, 2026
24dff7a
Merge branch 'claude-code-best:main' into main
2228293026 Apr 7, 2026
81792af
添加status命令里更多模型api介绍
Apr 7, 2026
8c09119
Merge branch 'claude-code-best:main' into main
2228293026 Apr 8, 2026
e2469b2
Merge branch 'claude-code-best:main' into main
2228293026 Apr 8, 2026
c01f089
Merge branch 'claude-code-best:main' into main
2228293026 Apr 8, 2026
43c8be6
docs: update contributors
2228293026 Apr 8, 2026
44e4020
Fix: /help error
Apr 8, 2026
4f1aa63
Merge branch 'claude-code-best:main' into main
2228293026 Apr 9, 2026
25bac1c
1. 修复 src/commands/fork/index.ts — 将空 stub 改为有效的 Command 定义
Apr 9, 2026
3bd5300
Merge branch 'claude-code-best:main' into main
2228293026 Apr 9, 2026
c02786d
Update src/commands/fork/fork.tsx
2228293026 Apr 9, 2026
10d4d33
fix
2228293026 Apr 9, 2026
06869c0
Merge branch 'claude-code-best:main' into main
2228293026 Apr 9, 2026
6c1100b
Merge branch 'claude-code-best:main' into main
2228293026 Apr 9, 2026
f624f25
Merge branch 'claude-code-best:main' into main
2228293026 Apr 9, 2026
13efceb
Merge branch 'claude-code-best:main' into main
2228293026 Apr 9, 2026
8ff58c9
Merge branch 'claude-code-best:main' into main
2228293026 Apr 10, 2026
5d170e8
Merge branch 'claude-code-best:main' into main
2228293026 Apr 10, 2026
7eb1e5f
Merge branch 'claude-code-best:main' into main
2228293026 Apr 11, 2026
49579f9
docs: update contributors
2228293026 Apr 11, 2026
ada7b3e
fix: disable strict mode in tsconfig to avoid decompilation type errors
Apr 11, 2026
fab0573
Merge branch 'claude-code-best:main' into main
2228293026 Apr 11, 2026
28c1987
docs: update contributors
2228293026 Apr 11, 2026
4cf61d1
Fix
Apr 11, 2026
bf5addb
Merge branch 'claude-code-best:main' into main
2228293026 Apr 11, 2026
49f310f
Merge branch 'claude-code-best:main' into main
2228293026 Apr 11, 2026
5fd12e0
Merge branch 'claude-code-best:main' into main
2228293026 Apr 11, 2026
32411a1
Merge branch 'claude-code-best:main' into main
2228293026 Apr 11, 2026
d68845d
Merge branch 'claude-code-best:main' into main
2228293026 Apr 12, 2026
8e00c3b
Merge branch 'claude-code-best:main' into main
2228293026 Apr 12, 2026
442a70e
Merge branch 'claude-code-best:main' into main
2228293026 Apr 12, 2026
69fc07b
Merge branch 'claude-code-best:main' into main
2228293026 Apr 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/commands/ultraplan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,13 @@ async function launchDetached(opts: {
if (!eligibility.eligible) {
logEvent('tengu_ultraplan_create_failed', {
reason: 'precondition' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
precondition_errors: eligibility.errors
.map(e => e.type)
.join(',') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
precondition_errors: Array.isArray((eligibility as any).errors)
? (eligibility as any).errors.map((e: any) => e.type).join(',') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
: undefined,
});
const reasons = eligibility.errors.map(formatPreconditionError).join('\n');
const reasons = Array.isArray((eligibility as any).errors)
? (eligibility as any).errors.map(formatPreconditionError).join('\n')
: '';
Comment on lines +370 to +376
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== RemoteAgentPreconditionResult / eligibility definitions =="
rg -nP --type=ts -C3 '\bRemoteAgentPreconditionResult\b|\bcheckRemoteAgentEligibility\b'

echo
echo "== current ultraplan eligibility handling =="
rg -nP --type=tsx -C4 'if \(!eligibility\.eligible\)|eligibility as any|precondition_errors|formatPreconditionError'

Repository: claude-code-best/claude-code

Length of output: 4913


🏁 Script executed:

sed -n '360,380p' src/commands/ultraplan.tsx

Repository: claude-code-best/claude-code

Length of output: 1088


Remove as any casts; the discriminated union type is already narrowed in this branch.

At line 367 (if (!eligibility.eligible)), the type system guarantees eligibility.errors is present and properly typed as BackgroundRemoteSessionPrecondition[]. The as any casts at lines 370–376 and the redundant Array.isArray() guards weaken type safety and violate the coding guideline: "Use type guards and Record<string, unknown> instead of as any in non-test code."

See the pattern in src/tools/AgentTool/AgentTool.tsx (line 672) for the correct approach: use a specific type assertion instead of as any.

Proposed fix
     if (!eligibility.eligible) {
+      const preconditionErrors = eligibility.errors.map(e => e.type)
       logEvent('tengu_ultraplan_create_failed', {
         reason: 'precondition' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
-        precondition_errors: Array.isArray((eligibility as any).errors)
-          ? (eligibility as any).errors.map((e: any) => e.type).join(',') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
-          : undefined,
+        precondition_errors:
+          preconditionErrors.join(',') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
       });
-      const reasons = Array.isArray((eligibility as any).errors)
-        ? (eligibility as any).errors.map(formatPreconditionError).join('\n')
-        : '';
+      const reasons = eligibility.errors.map(formatPreconditionError).join('\n')
       enqueuePendingNotification({
         value: `ultraplan: cannot launch remote session —\n${reasons}`,
         mode: 'task-notification',
       });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
precondition_errors: Array.isArray((eligibility as any).errors)
? (eligibility as any).errors.map((e: any) => e.type).join(',') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
: undefined,
});
const reasons = eligibility.errors.map(formatPreconditionError).join('\n');
const reasons = Array.isArray((eligibility as any).errors)
? (eligibility as any).errors.map(formatPreconditionError).join('\n')
: '';
if (!eligibility.eligible) {
const preconditionErrors = eligibility.errors.map((e) => e.type)
logEvent('tengu_ultraplan_create_failed', {
reason: 'precondition' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
precondition_errors:
preconditionErrors.join(',') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
});
const reasons = eligibility.errors.map(formatPreconditionError).join('\n')
enqueuePendingNotification({
value: `ultraplan: cannot launch remote session —\n${reasons}`,
mode: 'task-notification',
});
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands/ultraplan.tsx` around lines 370 - 376, The code is using "as
any" and redundant Array.isArray checks even though the branch if
(!eligibility.eligible) already narrows eligibility so eligibility.errors is a
BackgroundRemoteSessionPrecondition[]. Replace the Array.isArray((eligibility as
any).errors) guards and the as any casts by directly using eligibility.errors
(e.g. precondition_errors: eligibility.errors.map(e => e.type).join(','), and
const reasons = eligibility.errors.map(formatPreconditionError).join('\n')), or
if the compiler still needs help, cast eligibility to a specific shape (e.g.
eligibility as { errors: BackgroundRemoteSessionPrecondition[] }) rather than
using any.

enqueuePendingNotification({
value: `ultraplan: cannot launch remote session —\n${reasons}`,
mode: 'task-notification',
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"strict": true,
"strict": false,
"skipLibCheck": true,
"noEmit": true,
"esModuleInterop": true,
Expand Down
Loading