Skip to content

fix(acp): sync native agent session titles#1028

Open
swear01 wants to merge 3 commits into
tiann:mainfrom
swear01:agent/native-acp-session-titles
Open

fix(acp): sync native agent session titles#1028
swear01 wants to merge 3 commits into
tiann:mainfrom
swear01:agent/native-acp-session-titles

Conversation

@swear01

@swear01 swear01 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • consume native ACP session_info_update title events and sync them to HAPI session summaries
  • refresh titles through native ACP session/list for agents that persist titles without pushing an update; retry placeholder titles asynchronously
  • disable HAPI's change_title MCP tool for remote Cursor, OpenCode, and Kimi ACP sessions while preserving display_image
  • remove the OpenCode remote title prompt; keep existing non-ACP title behavior unchanged

Why

Cursor now emits the standardized ACP title update directly. Current OpenCode and Kimi sources generate and persist native titles exposed by session/list, but do not emit session_info_update. HAPI previously discarded the pushed title field and relied on its own MCP fallback.

This makes native agent title state authoritative for ACP sessions and removes that fallback from all three remote ACP launchers.

Closes #838.

Validation

  • bun typecheck
  • bun run test
    • CLI: 124 files, 1219 tests passed
    • Hub: 472 passed, 3 skipped
    • Web: 144 files, 1183 tests passed
    • Shared: 106 passed
  • focused ACP/title suite: 5 files, 63 tests passed
  • live Cursor ACP smoke: native session_info_update title reached the HAPI summary bridge
  • real MCP smoke: enableChangeTitle: false exposes only display_image

@swear01 swear01 marked this pull request as ready for review July 12, 2026 16:07

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings

  • [Major] ACP title refresh can hold a completed turn busy for up to the transport timeout. refreshSessionInfo() calls session/list with the default 120s request timeout, and the launchers await it before their finally blocks clear thinking and emit ready (cli/src/cursor/cursorAcpRemoteLauncher.ts:257, cli/src/opencode/opencodeRemoteLauncher.ts:288, cli/src/kimi/kimiRemoteLauncher.ts:174). If an ACP build is slow or wedges on session/list, the user cannot send the next prompt for up to two minutes after the model already finished.
    Suggested fix:
    const response = await this.transport.sendRequest('session/list', { cwd }, { timeoutMs: 5000 });
    and keep refresh off the turn-critical path in each launcher:
    void backend.refreshSessionInfo(acpSessionId, session.path);

Summary

  • Review mode: initial. Found one turn-readiness regression risk introduced by the ACP native title refresh path.

Testing

  • Not run (automation)

HAPI Bot

Comment thread cli/src/agent/backends/acp/AcpSdkBackend.ts Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings
No issues found.

Summary
Review mode: follow-up after new commits. No issues found in the latest diff. Residual risk: ACP title sync depends on native ACP agent behavior for session_info_update and session/list; reviewed statically because tests could not run here.

Testing
Not run: bun is not installed in this runner (/bin/bash: bun: command not found).

HAPI Bot

…ssion-titles

# Conflicts:
#	cli/src/agent/backends/acp/AcpSdkBackend.ts
@swear01 swear01 closed this Jul 13, 2026
@swear01 swear01 reopened this Jul 13, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings
No issues found.

Summary
Review mode: follow-up after new commits. No issues found in the latest full PR diff. Residual risk: reviewed statically because the runner does not have Bun installed, so the new ACP title-sync tests and CLI typecheck could not be executed here.

Testing
Not run: bun is not installed in this runner (/bin/bash: bun: command not found).

HAPI Bot

swear01 added a commit to swear01/hapi that referenced this pull request Jul 13, 2026
swear01 added a commit to swear01/hapi that referenced this pull request Jul 15, 2026
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.

fix(cursor): session title never updates in sidebar (missing change_title prompt + title handler)

1 participant