github / github/copilot-cli

"Rendered more hooks than during the previous render" error occurs

未關閉
#2,088 3 則留言 7 個 reaction 已指派 0 人 在 GitHub 檢視
area:agents area:terminal-rendering
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the bug

## Summary

A `Rendered more hooks than during the previous render` error occurs while using GitHub Copilot CLI, causing the current operation to abort.

## Version

- GitHub Copilot CLI: `1.0.6`
- OS: macOS 14.7.6

## Steps to Reproduce

1. Launch the `copilot` command
2. Invoke a skill that runs multiple sub-agents in parallel
3. The error occurs while the skill is running sub-agents

## Actual Behavior

The following error is printed and execution stops.

```
ERROR Rendered more hooks than during the previous render.

file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3898:3104

- Ma (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3898:3104)
- E1 (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3898:14278)
- Object.useMemo (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3988:5480)
- process.env.NODE_ENV.rl.useMemo (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:2918:12500)
- pie (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:4641:24035)
- react-stack-bottom-frame (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3988:12778)
- gm (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3898:812)
- w1 (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3905:18055)
- C1 (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3914:10109)
- nr (file:///Users/{username}/Library/Caches/copilot/pkg/universal/1.0.6/app.js:3863:112)
```

## Expected Behavior

No error occurs and the operation completes successfully.

## Additional Context

- This error is a violation of React's Rules of Hooks — the number of `useMemo` calls differs between renders. The stack trace suggests a conditional branch inside the `pie` component may be causing the hook call count to vary across renders.
- I tried running with --no-auto-update to pin to v1.0.5, and the parallel sub-agent execution worked without any issues. So the problem appears to be specific to the latest version.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。