Skip to content

feat(hq): fork a session from a message, compact it, and switch its agent and model - #984

Merged
Blind-Striker merged 1 commit into
masterfrom
feat/hq-turn-tools
Nov 23, 2026
Merged

Blind-Striker merged 1 commit into
masterfrom
feat/hq-turn-tools

Conversation

@Blind-Striker

Copy link
Copy Markdown
Collaborator

Summary

HQ's session page gets the turn tools upstream's app offers:

  • Fork from here on each sent prompt. It forks the session before that message, opens the new session, and puts the message back in its prompt box, as upstream's packages/app/src/session/fork.ts does. It is not offered on a prompt that is still pending.
  • Compact session in the session header, with upstream's label and tooltip. When the composer's model differs from the session's model, HQ switches the model first, then compacts (packages/client/src/solid/data.ts:1734-1757).
  • Choose agent and Choose model above the prompt box. On send, HQ switches the agent and then the model, and only when the choice differs from the session's (packages/app/src/composer/submit.ts:739-777). The lists use upstream's filters:
    • agents: primary agents that are not hidden, addressed by their id;
    • models: those of the listed providers, without deprecated ones.
  • The SDK panel gets three entries: "Forking from a message", "Compacting a session" and "Switching agent and model".

The end-to-end run against the server found two parity details, and this PR follows upstream on both:

  • A fork arrives as session.forked, not session.created. So the board adds the session that the fork call returns, as upstream's app does (fork.ts:91).
  • The server lists a folder's agents as empty until it has loaded that folder. Then it sends agent.updated, model.updated and provider.updated for that folder. HQ reads its choices again on those events, as upstream's client does (data.ts:1393-1402), and a read that a newer read replaced does not commit.

The transcript does not show compactions yet. Upstream's "Session compacted" marker is a separate item on the board.

Test

  • HQ tests: 165 pass. Each new behaviour failed first against a mutant of it: the fork's board entry, the catalog re-read and its folder filter, and the stale-read guard for both a success and a failure.
  • Full local gate.
  • End to end, against an isolated opencode serve at v2.3.2:
    • Agent and model: switching to plan and another model. The server records both on the session and on the reply's message.
    • Fork: the server records the fork boundary before the chosen message. The new session opens with its title and the message in the prompt box.
    • Compact: the server stores a manual compaction with the chosen model.
    • First open after a fresh server start: the agent picker fills once the server announces the folder's catalog.
    • Mobile, at 390 px: no horizontal scroll, and 44 px touch targets.

@Blind-Striker
Blind-Striker added this pull request to the merge queue Nov 23, 2026
Merged via the queue into master with commit f91846b Nov 23, 2026
15 checks passed
@Blind-Striker
Blind-Striker deleted the feat/hq-turn-tools branch November 23, 2026 20:42
@Blind-Striker Blind-Striker mentioned this pull request Nov 24, 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.

1 participant