Skip to content

feat(#599): expose pendingQuestion in get_status and REST endpoint#600

Merged
OneStepAt4time merged 1 commit intomainfrom
fix/issue-599-question-relay
Mar 31, 2026
Merged

feat(#599): expose pendingQuestion in get_status and REST endpoint#600
OneStepAt4time merged 1 commit intomainfrom
fix/issue-599-question-relay

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Summary

Closes #599 (intervention 1 of 3).

When a session enters ask_question state, get_status (MCP) and GET /v1/sessions/:id (REST) now include a pendingQuestion payload:

{
  "status": "ask_question",
  "pendingQuestion": {
    "toolUseId": "toolu_abc123",
    "content": "Which strategy? 1) Clean up 2) Auto-restart 3) Both",
    "options": ["Clean up", "Auto-restart", "Both"],
    "since": 1774906529600
  }
}

This closes the feedback loop for MCP callers that previously had no visibility into CC questions — the root cause of duplicate session spawns.

Changes (3 files, +71/-6)

File Change
src/session.ts Add timestamp to PendingQuestion, expose in getPendingQuestionInfo()
src/server.ts Extend addActionHints() with pendingQuestion payload + extractQuestionOptions() helper
src/__tests__/mcp-server.test.ts Add test verifying pendingQuestion flows through get_status

Verification

  • tsc --noEmit — exit 0
  • npm run build — exit 0
  • npm test — 75 files, 1734 tests passed, 0 failed

What is NOT in this PR

Interventions 2 and 3 from #599 (waitForStable on create_session and idempotency key) will be separate PRs.

@OneStepAt4time
Copy link
Copy Markdown
Owner Author

👁️ Argus Code Review

feat(#599): expose pendingQuestion in get_status and REST endpoint

Verdict: ✅ Approved — code is solid

What it does

Exposes pendingQuestion data (toolUseId, content, options, timestamp) in REST GET /sessions/:id and MCP get_status when a session is in ask_question state.

Checklist

Notes

  • extractQuestionOptions only handles numbered options (1. Foo, 2. Bar). If question format changes, returns null gracefully — fine for now.
  • The timestamp addition to PendingQuestion is clean and minimal.

Ready to merge after rebase.

@OneStepAt4time OneStepAt4time force-pushed the fix/issue-599-question-relay branch from 58fb45f to 5f17d2a Compare March 30, 2026 23:50
@OneStepAt4time OneStepAt4time self-assigned this Mar 30, 2026
Copy link
Copy Markdown
Owner Author

@OneStepAt4time OneStepAt4time left a comment

Choose a reason for hiding this comment

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

ok

Copy link
Copy Markdown
Owner Author

@OneStepAt4time OneStepAt4time left a comment

Choose a reason for hiding this comment

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

ok

When a session enters ask_question state, get_status (MCP) and
GET /v1/sessions/:id (REST) now include a pendingQuestion payload
with toolUseId, content, options, and since timestamp.

This closes the feedback loop for MCP callers that previously had
no visibility into CC questions, causing duplicate session spawns.

Changes:
- session.ts: add timestamp to PendingQuestion, expose in getPendingQuestionInfo()
- server.ts: extend addActionHints() with pendingQuestion payload + extractQuestionOptions()
- mcp-server.test.ts: add test verifying pendingQuestion flows through get_status

Closes #599 (intervention 1 of 3)
@OneStepAt4time OneStepAt4time force-pushed the fix/issue-599-question-relay branch from 5f17d2a to 3e11495 Compare March 30, 2026 23:59
@OneStepAt4time OneStepAt4time merged commit 38fc42f into main Mar 31, 2026
4 checks passed
@OneStepAt4time OneStepAt4time deleted the fix/issue-599-question-relay branch March 31, 2026 00:00
OneStepAt4time added a commit that referenced this pull request Mar 31, 2026
## [2.3.0](v2.2.6...v2.3.0) (2026-03-31)

### Features
* expose pendingQuestion in get_status and REST endpoint (#600)

### Bug Fixes
* ci: use RELEASE_PAT for release-please to trigger CI on PRs (#601)
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.

MCP callers never see CC questions — causes duplicate sessions

1 participant