Repository navigation
feat(reader): topology stack + branch chips + thread-continue shortcuts (#1203) - #1343
Conversation
Bridges the lineage topology (#1121) into the workspace stack route and adds per-message "continue this thread in another agent" deep-link shortcuts. Implements the #1203 work that was outstanding from MK3 Slice 6 (docs/design/mk3/docs/10-implementation-slices.md:104). Backend: - polylogue/daemon/topology_http.py grows build_parent_chain_envelope() which projects a SessionTopology into a stack-ready chain (root -> target -> descendants), with branch_kind, parent_id, and siblings surfaced for the popover/inspector. Uses the existing SessionTopology ancestors()/descendants()/siblings() helpers so the lineage walk stays in insights/. - GET /api/conversations/{id}/topology/parent-chain returns that envelope; ?descendants=0 narrows to the ancestor chain only. - polylogue/daemon/thread_continue.py owns the per-agent URL template registry (Claude Code, Codex, plus a copy-as-prompt clipboard fallback) and the URL constructor. Overrides flow through POLYLOGUE_READER_AGENT_TEMPLATES; invalid JSON falls back to the built-ins so the reader never crashes on a malformed env var. - GET /api/thread-continue-templates returns the active registry. Templates are substituted client-side so the daemon never observes the message text the operator is "continuing" elsewhere. Reader: - Conversation header gains a topology branch chip (continuation / sidechain / fork / subagent) using the MK3 q-* vocabulary, plus an "open chain" button that pre-populates the stack workspace with the parent chain. - Lineage inspector tab gains a third action: "Open chain as stack". - Per-message action rail gains a "continue" button that opens a small popover menu of agent templates; the copy-prompt entry writes to navigator.clipboard, every other entry hands off to the OS URL handler. Tests: - tests/unit/daemon/test_topology_stack.py covers chain ordering, branch-kind surfacing, sibling isolation, descendant exclusion, end-to-end dispatch against a seeded multi-generation tree, and the reader-shell structural contract (chip helpers, lineage action, parent-chain endpoint URL). - tests/unit/daemon/test_thread_continue.py covers the built-in registry, env override (add / replace / disable), URL substitution encoding, endpoint dispatch, and the action-button + JS hook presence in the shipped HTML. Budgets: - daemon/web_shell.py 1514 lines (1500 -> 1550), daemon/http.py 2062 lines (2050 -> 2100). Both file-size-budgets.yaml entries updated with the new endpoint/affordance attribution. - Topology projection re-rendered to include the new daemon/thread_continue.py module. Verification: - devtools verify --quick: exit_code 0 - devtools verify --seed-testmon --skip-slow: 8219 passed, 2 xfailed - Focused: pytest tests/unit/daemon/ -> 622 passed Closes #1203
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d728b00829
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Bridges the lineage topology view (#1121) into the workspace stack route and
adds per-message "continue this thread in another agent" deep-link shortcuts.
Implements the #1203 work that was outstanding from MK3 Slice 6
(
docs/design/mk3/docs/10-implementation-slices.md:104).Problem
MK3 Slice 6 called for the bridge between topology and the stack workspace —
"select this branch chip, open its parent chain as a stack workspace". #1121 /
PR #1176 landed the lineage and topology view; #1057 added the workspace shell
modes (tabs / stack / compare / timeline). The stack lane previously accepted
manually-entered conversation ids only — there was no UI affordance for
"render the root → sub-agent → continuation chain as a stack", and the
conversation header carried no branch chip telling the operator that a
conversation belonged to a multi-branch cluster.
Separately, the reader had no path back to the originating agent: an operator
who wanted to keep working a thread in Claude Code or Codex had to copy the
message text by hand. That is exactly the friction the MK3 design called out
as the "thread-resumption hub" idea (also tracked in the #1203 ambitious
section).
Solution
Substrate / daemon
polylogue/daemon/topology_http.pygrowsbuild_parent_chain_envelope()which projects a
SessionTopologyinto a stack-ready chain (root → target→ descendants) with
branch_kind,parent_id,siblings, andfocus_idsurfaced. Uses the existing
SessionTopology.ancestors() / descendants() / siblings()helpers so the lineage walk stays ininsights/.GET /api/conversations/{id}/topology/parent-chainreturns the envelope.?descendants=0narrows to the ancestor chain only.polylogue/daemon/thread_continue.pyowns the per-agent URL-templateregistry (built-ins:
claude-code,codex,copy-promptclipboardfallback) and the URL constructor. Overrides flow through
POLYLOGUE_READER_AGENT_TEMPLATES; invalid JSON falls back to thebuilt-ins so the reader never crashes on a malformed env var. Templates
are substituted client-side so the daemon never observes the message
text the operator is "continuing" elsewhere.
GET /api/thread-continue-templatesreturns the active registry envelope.Reader surface
web_shell.py) renders a topology branch chip(continuation / sidechain / fork / subagent / root) using the MK3 q-*
chip vocabulary, plus an "open chain" button next to it. The chip click
routes to the Lineage inspector tab as the popover surface.
web_shell_lineage.py) gains a third action,"Open chain as stack", so the same affordance is reachable from either
the header or the inspector.
web_shell_workspace.py) gainsopenParentChainAsStack(id)which fetches the parent-chain envelope and routes to
/w/stack?ids=…&focus=….web_shell_reader.py) gains acontinuebuttonthat opens a small popover menu of agent templates. The
copy-promptentry writes to
navigator.clipboard; every other entry hands off to theOS URL handler. The template registry is fetched once per session and
cached.
Alternatives rejected
/topologyenvelope. Rejected: that envelope is BFS-ordered and bounded by node
count; the stack needs the explicit ancestor walk + focus anchor. A
dedicated endpoint also keeps the topology→stack contract single-sourced
for tests.
polylogue.tomllike the embeddingkeys. Rejected for this PR scope: an env-var override is sufficient for
the operator workflow and avoids a config-schema migration. Can be
promoted to TOML later without breaking the endpoint shape.
Verification
File-size budgets updated to reflect the +14 lines on
web_shell.py(branch chip helpers,
openLineageInspector) and +52 lines onhttp.py(two new handlers + dispatch). Topology projection re-rendered to
include the new
daemon/thread_continue.pymodule.Closes #1203