feat(runtime): add requestData and requestManualAction APIs (design spec inside)#102
Draft
feat(runtime): add requestData and requestManualAction APIs (design spec inside)#102
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Draft
4 tasks
This was referenced Apr 20, 2026
tnunamak
added a commit
that referenced
this pull request
Apr 20, 2026
…#111) ## Summary Two independent runtime bug fixes, extracted from #102 so they can ship without waiting on the interaction-API redesign. - **`goHeadless()` navigates to `https://chatgpt.com/`** after reopening the headless context (line 811 on `main`). Every connector using `goHeadless()` — oura, spotify, github, etc. — incurs an unnecessary network roundtrip to `chatgpt.com` and leaks ChatGPT-specific state into unrelated sessions. Change to `about:blank`. - **`legacyAuthTriggered` silently discards valid results.** When `showBrowser()` or `promptUser()` is called in `--no-input` mode and the connector still manages to collect data (e.g. from cached cookies), the post-run gate at line 358 drops the result. Remove the gate. The flag stays — it still deduplicates `legacy-auth` events in `showBrowser`/`promptUser`. ## Why split from #102 #102 bundles these fixes with the `requestData` / `requestManualAction` API redesign. The redesign is the right direction but needs coordinated rollout across four repos (this one, `data-connect`, `context-gateway`, `data-connectors`). These two fixes help every connector user today and don't depend on any of that. See also: `data-connect` companion PR for the same `goHeadless → about:blank` fix in `playwright-runner/index.cjs`. ## Test plan - [ ] CI green - [ ] `npx vana collect oura --no-input --json` — verify no stray `chatgpt.com` request in the headless phase - [ ] `npx vana collect chatgpt --no-input --json` — verify a valid session still returns a clean result (the previously-discarded path) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tnunamak
added a commit
to vana-com/data-connect
that referenced
this pull request
Apr 20, 2026
## Summary `goHeadless()` in `playwright-runner/index.cjs` navigated to `https://chatgpt.com/` after reopening the headless context (line 739). Every connector using `goHeadless()` — oura, spotify, github, etc. — incurs an unnecessary network roundtrip to `chatgpt.com` and leaks ChatGPT-specific state into unrelated sessions. Change to `about:blank`. Same copy-paste bug exists in `vana-connect`'s `in-process-run.ts`; fixed in companion PR vana-com/vana-connect#111. The two runtimes don't share code, so the fix has to land in both. Extracted from the interaction-API redesign work (vana-com/vana-connect#102) so it can ship independently. ## Test plan - [ ] CI green - [ ] Run a non-ChatGPT connector in the desktop app (e.g. oura) through the headless-switch path, verify no stray `chatgpt.com` request 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Bug fixes: - goHeadless() navigated to https://chatgpt.com/ instead of about:blank, causing an unnecessary network roundtrip for every connector - legacyAuthTriggered flag silently discarded valid connector results when showBrowser() was called in --no-input mode but the connector still collected data from cached cookies New APIs (old APIs remain unchanged for backward compatibility): requestData(schema) — like requestInput but returns a result object instead of throwing in --no-input mode: { status: 'success', data } or { status: 'skipped', reason: 'no-input' } requestManualAction(message, checkFn, options?) — merges showBrowser + promptUser + goHeadless into one call. Returns: { status: 'success' } or { status: 'skipped', reason: 'no-input' } No legacy-auth event emitted; the connector decides what to do with a skip. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Guard against skip results being persisted as collected data if a connector accidentally returns a requestData/requestManualAction result - Extract collectInput helper to deduplicate requestInput/requestData - Remove redundant nullish coalescing in collectInput - Match log prefixes to existing [prompt] convention
Match both status === "skipped" AND reason === "no-input" to avoid suppressing legitimate connector data that happens to have a "status" field. Flagged by Codex review.
Adds the OpenSpec change proposal covering the full rollout of the requestData / requestManualAction contract across vana-connect, data-connect, context-gateway, and data-connectors. Captures the rationale, the per-runtime skip semantics (no-input vs no-headed-browser), the strict runtime-first rollout order, and the tasks required to retire the old four-method surface. Validated with `openspec validate redesign-connector-interaction-api --strict`.
3d6eb93 to
5f3c748
Compare
Member
Author
|
Force-pushed an update. Two changes on top of the previous PR state:
See the updated PR description for the detailed status and what's covered in the plan. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
requestDataandrequestManualActionto the connector page API, each returning anInteractionResult({ status: "success", data? } | { status: "skipped", reason }). Old APIs (requestInput,promptUser,showBrowser,goHeadless) remain unchanged for backward compatibility — migration is per-connector.Status update (2026-04-20)
openspec/changes/redesign-connector-interaction-api/(proposal, tasks, design, spec).main.What the OpenSpec change covers
openspec/changes/redesign-connector-interaction-api/validates withopenspec validate ... --strict. It captures:InteractionResultfixes it.vana-connectanddata-connectskip on--no-inputwithreason: "no-input";context-gatewayalways skips withreason: "no-headed-browser"because it never surfaces a headed browser.TypeErrorat runtime.vana-com/data-connect,vana-com/context-gateway,vana-com/data-connectors(plus PR feat(connect): refine user-facing connect flows #46's connector migrations).legacyAuthTriggeredand CG'spromptUser-throw after migrations complete.Context (original investigation)
Investigated a bug where
vana statusshowed "needs login" for ChatGPT when the session was valid. Root cause was a connector bug (checking login onabout:blank), fixed in vana-com/data-connectors#44. But the investigation revealed deeper design issues:--no-inputsemantics (throw vs return value vs silent no-op)legacy-authevents that the CLI treated as terminal outcomes mid-runThe new APIs follow a consistent contract: always return a result object, never throw for expected states, let the connector decide what to do.
Test plan
requestDatain--no-inputmode (tracked as task 1.5 in the OpenSpec plan)requestManualActionin--no-inputmode (tracked as task 1.6)🤖 Generated with Claude Code