refactor(arena): move arena-bridge to context and add reactive manager tracking

- Move useArenaInProcess from AppContainer to AgentViewProvider
- Replace polling with config.onArenaManagerChange() callback
- Add success-type progress messages when agents finish tasks
- Add isSuccessStatus helper for IDLE/COMPLETED status checks
- Reset input history position when arena session starts

This improves separation of concerns and eliminates the 500ms polling
interval in favor of immediate reactive updates when the arena manager
changes.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-10 21:45:30 +08:00
parent addbdcb0ef
commit d7aa98a0c0
13 changed files with 178 additions and 134 deletions

View file

@ -338,6 +338,17 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
onChange: customSetTextAndResetCompletionSignal,
});
// When an arena session starts (agents appear), reset history position so
// that pressing down-arrow immediately focuses the agent tab bar instead
// of cycling through input history.
const prevHasAgentsRef = useRef(hasAgents);
useEffect(() => {
if (hasAgents && !prevHasAgentsRef.current) {
inputHistory.resetHistoryNav();
}
prevHasAgentsRef.current = hasAgents;
}, [hasAgents, inputHistory]);
// Effect to reset completion if history navigation just occurred and set the text
useEffect(() => {
if (justNavigatedHistory) {