Skip to content

feat(chat): add ask_user_question interaction flow - #336

Closed
Pandakingxbc wants to merge 1 commit into
mainfrom
feature/ask-user-question
Closed

feat(chat): add ask_user_question interaction flow#336
Pandakingxbc wants to merge 1 commit into
mainfrom
feature/ask-user-question

Conversation

@Pandakingxbc

Copy link
Copy Markdown
Collaborator

Summary

  • Add a built-in ask_user_question structured tool for every agent, backed by LangGraph interrupt/resume.
  • Persist pending questions in SQLite/PostgreSQL so Dashboard refreshes and process restarts can recover the interaction.
  • Support Channel text interaction through /answer; a normal message is accepted automatically only for one unambiguous free-text question.
  • Add a Dashboard question card with single choice, multi-select, custom input, skip, question paging, recommended badges, and explicit final submission.
  • Reuse the existing chat stream for resume output, nested questions, nested tool approvals, usage tracking, and completed-turn bookkeeping.
  • Keep ask_user_question outside tool-approval HITL rules to avoid approval deadlocks.
  • Add English and Chinese tool, slash-command, card, and error copy.

Product behavior

  • One to three questions are supported per tool call.
  • A single-choice click advances to the next question; the final question still requires Submit.
  • Multi-select questions require Continue or Submit.
  • Channel choice questions use /answer <number-or-label>; batches use /answer 1=value; 2=value.
  • Pending records use an atomic pending -> resuming -> answered transition, with release on resume failure and recovery after restart.

Validation

  • uv run ruff check src tests
  • uv run mypy src/octop
  • Relevant backend suites: 115 passed, 1 skipped; added Channel projection suite: 5 passed
  • Dashboard focused tests: 6 passed
  • npx eslint on all changed Dashboard TypeScript files
  • npx tsc --noEmit
  • npm run build
  • Dashboard full suite: 449 passed, 1 unrelated existing failure in publishedExperts.test.ts because its expectation omits the refresh request body already sent by main

The repository-wide backend suite was stopped at 12% as requested; no failure had appeared before interruption.

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