Provider seam: optional deep-link capability (DeepLinker) + provider-owned open metadata (prep for #2) #6
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Prep work for #2 (Codex provider). Triage of #2 resolved its open attach-story question: OpenAI's remote-connections feature cannot attach a headless CLI session on a Linux server (it requires the Codex desktop App as host, macOS/Windows, QR pairing — see https://developers.openai.com/codex/remote-connections), so a Codex session will have no web Open link. The deep-link machinery must therefore become an optional provider capability instead of a mandatory part of the
AgentProviderseam. None of this needs Codex itself — it is a refactor of the existing claude-code-only codebase, and it fixes an existing violation of the provider-isolation rule: core instance code currently imports the claude-code package to compare against its generic-deep-link constant, and the SPA hardcodes theclaude.aifallback URL.Agent Brief
Category: enhancement
Summary: Make deep-link capture an optional provider capability (
DeepLinker), move the open-affordance fallback into provider-owned metadata, and give link-less providers a copyable tmux-attach affordance in the UI.Current behavior:
CaptureDeepLinkis a mandatory method on theAgentProviderinterface. On a miss it returns the provider's generic fallback link, and the instance service detects a miss by comparing the result against the claude-code package's exported generic-link constant — a provider-specific import in core. The SPA's open-state logic hardcodeshttps://claude.ai/codeand a claude-specific tooltip as the universal fallback, so every instance row always renders a claude.ai link even if its provider had no such concept.Desired behavior:
Deep-link capture is an optional capability, following the existing
ConnectingReporterpattern: a separateDeepLinkerinterface that providers may implement. For providers that don't, no capture machinery ever arms (neither at Start nor at startup re-adoption) anddeep_link_urlstays NULL. The capture contract simplifies: a miss returns an empty string — generic fallbacks are no longer returned through capture, so the write-only-on-hit rule needs no provider-specific constant. Each provider's fallback open link (and its explanatory tooltip text) becomes provider-owned metadata exposed through the providers API; the SPA's open-state logic is driven by that data. An instance row whose provider has no fallback link renders a copyable attach affordance instead — copyingtmux attach -t <session_name>(the session name is already in the instances API) with a tooltip explaining the session is driven from a terminal on the lab host. Connecting-pulse and exact-link behavior for claude-code stays exactly as it is today.Key interfaces:
provider.AgentProvider— losesCaptureDeepLink; everything else unchanged.provider.DeepLinkeroptional interface —CaptureDeepLink(ctx, sessionName, worktree) (string, error); empty string means miss. The claude-code provider implements it and stops returning its generic link from capture.DeepLinker; the claude-code import in core goes away.DeepLinkerand a non-DeepLinkerprovider.Acceptance criteria:
DeepLinkerruns manual and AFK sessions end to end with no capture goroutine armed at Start or at startup re-adoption, and its runs keepdeep_link_urlNULL.claudecode/claude.aioutside the provider implementations and their tests.tmux attach -t <session>affordance with an explanatory tooltip.Out of scope: