Skip to content

feat(chat): add send-to-board action for save_analysis tool results#34

Merged
tendtoyj merged 4 commits into
mainfrom
tendtoyj/PLU-389-feat-send-to-board
Feb 27, 2026
Merged

feat(chat): add send-to-board action for save_analysis tool results#34
tendtoyj merged 4 commits into
mainfrom
tendtoyj/PLU-389-feat-send-to-board

Conversation

@tendtoyj

Copy link
Copy Markdown
Collaborator

Summary

  • 채팅에서 save_analysis tool 실행 결과를 보드에 바로 보낼 수 있는 "Send to Board" 액션 버튼을 추가하고, tool 이벤트의 start/end 매칭 안정성을 개선한 PR입니다.

Changes

  • send-to-board 액션 버튼 추가: save_analysis tool 완료 시 embeddable asset을 감지하여 "Send to Board" 버튼을 노출 (toolAssetDetector.ts, ToolRenderer.tsx, ToolGroupRenderer.tsx)
  • board selector modal 연동: 활성 보드가 없을 경우 board selector modal을 통해 보드 선택 후 asset embed 플로우 진행 (page.tsx)
  • 액션 reveal 애니메이션: send-to-board 버튼이 자연스럽게 나타나도록 애니메이션 적용
  • tool_call_id 안정화 (Backend): event_mapper.py에서 _resolve_tool_call_id 메서드를 추가하여 tool start/end 이벤트 간 동일한 tool_call_id가 전파되도록 수정. _tool_stacklist[dict]로 변경하여 tool_call_id를 start→end로 전달
  • 이벤트 조회 최신 윈도우 방식 변경 (Backend): ChatRepository.get_conversation_events가 CTE를 사용하여 최신 N개 이벤트를 반환하도록 쿼리 개선
  • 테스트 추가: tool_call_id 안정성 테스트, 최신 윈도우 이벤트 조회 테스트, toolAssetDetector 유닛 테스트
  • 정리: 사용하지 않는 AssetEmbedTestButtons 컴포넌트 삭제, 프로젝트 에셋(screenshot, UI svg) 추가

Test plan

  • save_analysis tool 완료 후 "Send to Board" 버튼이 표시되는지 확인
  • 활성 보드가 있을 때 버튼 클릭 시 DisplayConfigModal이 열리는지 확인
  • 활성 보드가 없을 때 버튼 클릭 시 board selector modal → 보드 선택 → embed 플로우가 정상 동작하는지 확인
  • Backend: pytest backend/tests/agent/test_orchestrator_display_order.py 통과
  • Backend: pytest backend/tests/services/test_chat_repository_event_contract.py 통과
  • Frontend: node --test frontend/pluto_duck_frontend/components/chat/renderers/__tests__/toolAssetDetector.test.ts 통과

Closes PLU-389

🤖 Generated with Claude Code

tendtoyj and others added 4 commits February 26, 2026 15:32
- Add _resolve_tool_call_id to event_mapper for consistent tool_call_id propagation
- Change tool_stack from list[str] to list[dict] to carry tool_call_id through start→end
- Fix get_conversation_events to return latest window via CTE instead of earliest rows
- Allow ToolGroupRenderer to show send-to-board for individually completed children
- Remove unused AssetEmbedTestButtons component
- Add tests for tool_call_id stability and latest-window event query
- Add project assets (screenshot, UI svg) and update README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tendtoyj tendtoyj self-assigned this Feb 27, 2026
@tendtoyj tendtoyj merged commit 47a0d1e into main Feb 27, 2026
1 check passed
@tendtoyj tendtoyj deleted the tendtoyj/PLU-389-feat-send-to-board branch February 27, 2026 14:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a94126125

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +526 to +529
if self._tool_stack:
tool_context = self._tool_stack.pop()
tool_name = tool_context["name"]
tool_call_id = tool_context["tool_call_id"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Correlate tool end events by tool_call_id

on_tool_end always pops the most recent stack entry and ignores the current callback's tool_call_id while the stack is non-empty, so overlapping tool executions can be mismatched (e.g., start A, start B, end A will be emitted with B's id). In that case the frontend tool correlator (which keys by tool_call_id) will merge outputs into the wrong tool row, causing incorrect status/output pairing and actions like send-to-board to attach to the wrong call.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant