Skip to content

feat: chat UI overhaul — render pipeline, prompt profiles & UX fixes#20

Merged
tendtoyj merged 116 commits into
mainfrom
tendtoyj/plu-256-308-chat-ui-overhaul
Feb 9, 2026
Merged

feat: chat UI overhaul — render pipeline, prompt profiles & UX fixes#20
tendtoyj merged 116 commits into
mainfrom
tendtoyj/plu-256-308-chat-ui-overhaul

Conversation

@tendtoyj
Copy link
Copy Markdown
Collaborator

@tendtoyj tendtoyj commented Feb 9, 2026

Closes PLU-256
Closes PLU-308

Summary

  • 채팅 렌더 파이프라인을 3계층(이벤트 수집 → 타임라인 변환 → 표시)으로 구조화하여 메시지 순서 꼬임, 로딩 혼선, tool 출력 매칭 오류를 근본적으로 해결
  • 프롬프트 실험 프로파일 시스템(v1~v4) 도입 및 Streamlit 기반 프로파일 에디터 추가
  • 채팅 UI 전반의 버그 수정 및 UX 개선 (탭 관리, 제출 제어, HITL 승인 플로우, 스트리밍 로더 등)

Changes

채팅 렌더 파이프라인 구조화 (PLU-308)

  • chatTimelineReducer, chatTimelineAdapter, eventIntentRegistry 등 타임라인 처리 모듈 신규 구축
  • useMultiTabChat 훅을 탭 상태/타임라인/복원 등 서브모듈로 분리
  • display_order 기반 이벤트 정렬을 백엔드(orchestrator, event_mapper, repository)와 프론트엔드 양쪽에 적용
  • reasoning span 위상 분리, 크로스런 타임라인 정렬, 중복 이벤트 제거 등 안정성 강화

채팅 UI 버그 수정 및 UX 개선 (PLU-256)

  • 스트리밍 중 채팅 제출 차단 및 submit eligibility 계약 도입
  • HITL 승인 카드 렌더링 및 decision API 연결
  • 세션 스켈레톤 로더, 로딩 모드 라우팅 분리 (히스토리 로드 vs AI 응답 대기)
  • 탭 전환 결정성 확보, stale response 가드, 채팅 버블 오버플로우 수정
  • stale run에 대한 mark_run_completed 호출 방지

프롬프트 실험 프로파일 시스템

  • v1~v4 프로파일 번들(YAML + 블록 마크다운) 및 상속 resolver 구현
  • 프로파일 기반 시스템 프롬프트 조립으로 composer 리팩터링
  • base_agent_prompt, memory_guide, skills_guide 블록 외부화
  • Streamlit 프롬프트 프로파일 에디터(생성/편집/삭제/미리보기) 추가

기타

  • AI SDK 의존성 제거 및 로컬 타입 대체
  • GPT-5 reasoning 지원을 위한 LLM 서비스/설정 정규화
  • TS 빌드 깨지는 중복 헬퍼 제거

Test plan

  • 프론트엔드 타임라인 관련 단위 테스트 통과 확인 (chatTimelineReducer, chatTimelineAdapter, eventIntentRegistry, chatLoadingState 등)
  • useMultiTabChat 탭/타임라인 테스트 통과 확인
  • 백엔드 프롬프트 실험 통합 테스트 통과 확인 (test_prompt_experiment, test_prompt_experiment_integration)
  • orchestrator display_order 및 stale run 가드 테스트 통과 확인
  • 실제 채팅에서 메시지 순서가 올바르게 표시되는지 수동 확인
  • 탭 전환, 히스토리 로드, 스트리밍 중 제출 차단 등 UX 시나리오 수동 검증
  • HITL 승인 플로우 동작 확인

🤖 Generated with Claude Code

tendtoyj and others added 30 commits February 7, 2026 15:25
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move skills_list adjacent to skills_guide and push memory/dataset
blocks to the end for better logical grouping in the system prompt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace generic <!-- rendered at runtime --> comments with
representative sample content for user_profile, memory_section,
memory_context, dataset, and skills_list blocks. Each sample
retains the runtime comment to distinguish from static blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move runtime back before base_agent_prompt and memory_guide
before user_profile for correct layering precedence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tendtoyj and others added 19 commits February 8, 2026 22:46
Add monotonic display_order counter to PlutoDuckEventCallbackHandler
that assigns unique ordering values in _canonicalize_event_metadata().
Extend ChatRepository to persist and retrieve display_order for both
events and messages, with DB fallback via get_next_display_order().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… emit

Make orchestrator emit() the single point of display_order assignment
for all event paths. Events from ApprovalBroker and finally/except
blocks now flow through emit() which auto-assigns display_order from
the callback handler counter when missing. This eliminates duplicate
display_order values in HITL flows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add display_order field to timeline types, API interfaces, and the
reducer. When present, display_order takes priority over run-based
sequence ordering, enabling correct global sort across mixed message
and event items from different runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… profile editor

- Make DEFAULT_PROFILE_ID a single source of truth in prompt_experiment.py
- context.py now imports from prompt_experiment instead of hardcoding "v3"
- Add "Set as Default" button in Streamlit profile editor sidebar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update DEFAULT_PROFILE_ID from "v3" to "v4"
- Replace hardcoded "v3" assertions with DEFAULT_PROFILE_ID constant
- Rename test to test_resolve_profile_id_defaults_to_configured_default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Consolidate response formatting rules and remove redundant sections
- Simplify file reading guidance into concise inline notes
- Remove hardcoded "Prompt Profile: v3" from v4 memory_guide
- Reorder sections for clearer prompt flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…chat-ui-overhaul

# Conflicts:
#	backend/pluto_duck_backend/agent/core/deep/context.py
#	backend/pluto_duck_backend/agent/core/deep/event_mapper.py
#	backend/pluto_duck_backend/agent/core/deep/prompt_experiment.py
#	backend/tests/agent/test_prompt_experiment.py
#	backend/tests/agent/test_prompt_experiment_integration.py
#	backend/tests/services/test_llm_settings.py
#	frontend/pluto_duck_frontend/hooks/useMultiTabChat.ts
#	scripts/prompt_profile_editor.py
@tendtoyj tendtoyj self-assigned this Feb 9, 2026
@Fluxloop-AI Fluxloop-AI deleted a comment from chatgpt-codex-connector Bot Feb 9, 2026
@tendtoyj
Copy link
Copy Markdown
Collaborator Author

tendtoyj commented Feb 9, 2026

@codex review

@Fluxloop-AI Fluxloop-AI deleted a comment from chatgpt-codex-connector Bot Feb 9, 2026
Copy link
Copy Markdown

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

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: e61cdc6e8b

ℹ️ 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 thread backend/pluto_duck_backend/agent/core/orchestrator.py
Initialize PlutoDuckEventCallbackHandler with the next available
display_order from the DB so that subsequent runs in an ongoing
conversation do not restart numbering at 1, preventing duplicate
display_order values in real-time SSE streams.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tendtoyj tendtoyj merged commit da435a2 into main Feb 9, 2026
1 check passed
@tendtoyj tendtoyj deleted the tendtoyj/plu-256-308-chat-ui-overhaul branch February 9, 2026 06:29
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