Skip to content

feat(ai): add CLI question retrieval and unify Ask AI controls - #3259

Merged
abose merged 8 commits into
mainfrom
ai
Oct 7, 2026
Merged

abose merged 8 commits into
mainfrom
ai

Conversation

@abose

@abose abose commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Ask AI transfers currently expose generated context JSON and temporary image paths in the CLI composer. A failed native edit can also leave a reservation behind, causing the next edit to be refused as “another CLI edit is still in progress.” This PR supplies the core changes for a concise question-reference handoff and removes Node-side pending-edit tracking, together with the paired Pro implementation.

Companion: https://github.com/phcode-dev/phoenix-pro/pull/278. tracking-repos.json pins Pro to 9379a39aa807f12a17e1476b09f4b5a4a5f03f22.

Changes

  • Add the CLI-only getUserQuestion(questionId) MCP tool. It retrieves the transferred question, captured source context and screenshot image blocks through the existing authenticated connector. The tool description limits retrieval to IDs supplied in a user transfer.
  • Remove pendingEdits bookkeeping and the disconnected-session exception for completion hooks. Together with Pro's reservation removal, retries no longer depend on an earlier completion hook arriving. Dirty-buffer checked saves and genuine conflict protection remain.
  • Remove the obsolete Claude attachment-directory grant; the paired handoff keeps question snapshots in memory instead of creating temporary image files.
  • Add terminal-local transfer HUD styling, connection/refusal messages, and explicit “Trust all and continue” guidance after reviewing Phoenix's hooks.
  • Use the shared sparkle icon in the Markdown selection toolbar and provide styling/labels for consistent Ask AI controls. Remove strings/styles for the redundant selection overflow menu.
  • Move the Pro-only Markdown dialog assertion out of the Community suite into Pro's registered coverage. Add connector regressions for missing completion hooks and disconnected sessions.

Validation

  • Latest reservation changes: connected Windows and macOS Tauri runners each passed unit:AI CLI Connector 50/50 and the companion integration:AI Connector Peers suite 33/33.
  • Real Claude Code and Codex CLI sessions were exercised through their terminal composers on both platforms. Failed edits followed by valid retries succeeded, unsaved markers survived, and editor/disk content matched. Claude's pre-read hook performed the automatic save; Codex explicitly flushed before editing. On Mac Codex, the failed patch had a pre-hook but no observed completion hook, and the retry still succeeded.
  • Earlier handoff revision: integration:AI CLI Composer 17/17 and integration:AI CLI Connector 14/14 passed on Windows, macOS and Linux. These use real terminal fixtures without model access.
  • npm run lint, including the final pre-commit check, and diff checks passed. The handoff revision also passed npm run release:prod; that production build was not repeated after the reservation changes.

Existing CLI sessions need restarting to load the new MCP tool catalog. The latest reservation changes have not yet been verified in the running Linux app; that check awaits a reload. Verification details and the separate nonmodal conflict-banner TODO are in the companion Pro documentation.

abose added 8 commits October 6, 2026 12:36
Native GITHUB_ACTIONS detection ran asynchronously without delaying suite
registration. Linux debug CI could therefore run credential-dependent suites
before their existing exclusions saw the CI flag, causing keyring errors and
cascading login failures.

Expose a test-window readiness promise and await it before loading extension
suites. Preserve native lookup failures for the runner to report, keep browser
detection synchronous, and add eight registered Jasmine cases covering delayed
detection, failures, and normal editor windows. No new exclusions or changes
to normal editor behavior.

Validation: all 8 unit:Test Environment specs passed in the connected Windows
Tauri runner; npm run lint and git diff --check passed. Linux GitHub Actions
has not been rerun for this change.
Direct agents to the concise Pro task overview and the detailed shared
handoff. Require synchronized status and ownership updates, coordination of
shared work, and archival of a parent only after all children and required
verification are complete.

Pin phoenix-pro to 9caab0ec33980aadf66c4b5aa0cd403311f9f90b, which adds the
active/completed task files and renames the handoff with updated references.

Validation: documentation links and heading anchors resolve; whitespace
checks pass. No runtime behavior changed.
Linux Electron suites registered their GitHub Actions exclusions before the
asynchronous NodeUtils environment lookup completed. Waiting later in
setupAndRunTests did not prevent keyring-dependent core and Pro suites
from registering and failing on CI runners without a keyring.

Include the CI flag in the existing Node boot response and set it in both
native loaders before resolving nodeSetupDonePromise. Wait for that
promise before loading SpecRunner's AMD suites, remove the late lookup,
and fail startup visibly when boot metadata is missing.

Replace helper-only checks with registration-time coverage that compares
the inherited environment, boot metadata, and actual credential specs.

Validation: environment suite 4/4 on Windows Tauri, macOS Tauri, and Linux
Electron with GITHUB_ACTIONS=true; Linux credential and Pro desktop-login
exclusion markers each 1/1; full macOS unit category 3039/3039; npm run
build and lint passed. Hosted Actions verification remains after push.
Move the Builder listener and local process ownership into the development
server. Each stdio MCP adapter connects to the shared hub with its own
session, while request routing preserves the existing Phoenix protocol.
Include canonical machine IDs in app greetings and status discovery.

Add explicit whole-machine reservations with a FIFO queue, dequeue and
release operations. Release ownership on adapter socket disconnect without
heartbeats, retain source-change notes across disconnects and hub restarts,
and return those notes to the next owner. Add read-only polling and a bounded
notification callback for reservation monitors. Keep one bounded terminal
log history with independent per-agent cursors.

Integrate isolated Node fixtures with the existing Jasmine runner and CI
test packaging. Document setup, coordination and the remaining host-specific
idle wakeup integration. Update the Pro pin to 9ba095f6 for the rollout and
verification handoff.

Validation: 29/29 Builder specs on Windows Tauri, macOS Tauri and Linux
Electron; identity suite 6/6 on Windows; two real stdio adapters verified
reply routing and disconnect handoff against a live Linux runner. The
development-server startup/shutdown smoke and activated hub reserve/release
check passed. Full macOS unit category passed 3039/3039 before the added
monitor/log cases. Build passed before heartbeat removal; final targeted
lint, syntax checks and commit checks passed. Hosted CI remains to verify.
@abose
abose merged commit 7e9ab5d into main Oct 7, 2026
17 of 18 checks passed
@abose
abose deleted the ai branch October 7, 2026 08:23
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.5% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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