11 KiB
Created
Created by LocalTicketBackend create.
Comment
Dependency note: local role/session registry
Companion lifecycle should remain separate from Ticket/role Pod claim authority. Local role session and Ticket claim data belongs in the user-data workspace overlay planned by workspace-panel-local-role-session-registry, not in git-tracked Ticket metadata.
The Companion may eventually read/display this derived status, but it should not own the registry or gain mutation authority by default.
Plan
Preflight / implementation intent
Decision:
- The workspace Companion Pod id/name is the workspace directory basename.
- For this repository, that id/name is
yoi. - Do not introduce a separate
yoi-companionidentity for the normal workspace Companion. yoi panelshould treat an existing live/restorable default workspace Pod namedyoias the Companion.- The workspace Orchestrator remains a distinct identity such as
yoi-orchestrator.
Readiness:
- This ticket is implementation-ready after
workspace-orchestrator-spawn-diagnostic-persistencelanded. - Orchestrator scope conflict diagnostics are now persistent enough to distinguish expected scope conflicts from plain missing state during panel dogfooding.
Current code map:
crates/tui/src/multi_pod.rs- owns panel load/reload,
MultiPodApp, composer target dispatch, pending reloads, and current Orchestrator lifecycle glue. - current Companion composer target is not backed by a real Companion lifecycle and should be connected here or through a small helper module.
- owns panel load/reload,
crates/tui/src/workspace_panel.rs- owns panel model/header rows/composer target model and diagnostics.
crates/tui/src/pod_list.rs- Pod list/read/restore/open helpers may be useful for determining live/restorable Companion presence.
crates/client/src/ticket_role.rs- Ticket role launcher is separate; Companion is not a Ticket role and should not be implemented as one.
crates/client/src/runtime_command.rsand existing Pod spawn/restore client helpers- likely source for typed runtime command and one-shot socket interaction.
Implementation intent:
- Add a workspace Companion lifecycle alongside, but not inside, the Ticket Orchestrator lifecycle.
- On
yoi panelopen, resolve the Companion Pod name from the workspace directory basename (yoihere). - If that Pod is live, use it; if restorable, restore it; if missing, spawn it with the configured/default Companion profile path as appropriate.
- Panel close must not stop it.
- Route the panel
Companioncomposer target to this Companion Pod's user history. - Preserve Ticket Intake as a separate target; Intake text must not be appended to Companion history.
- Keep no-Ticket workspaces functional: Companion management chat plus Pod inspect/open should work without
.yoi/ticket.config.toml. - Do not reintroduce selected-Pod direct send,
--multi, or:ticket.
Risks / boundaries:
- Companion should not be treated as a Ticket role and should not claim Ticket role session authority.
- Existing live
yoiPod may already own workspace write scope; the panel should reuse/attach/route to it rather than trying to spawn anotheryoiand failing with a scope conflict. - If
yoiis live but busy, message send behavior should follow existing Pod client semantics and report bounded diagnostics rather than inventing queueing in this ticket. - Avoid broad UI restructuring; keep lifecycle state and diagnostics explicit and testable.
- If nonblocking spawn/restore requires more work, keep the implementation compatible with
workspace-panel-nonblocking-transitionsrather than solving that entire ticket here.
Validation expected:
- Focused TUI tests for Companion naming (
yoifrom repo dir), live/restorable/missing lifecycle decisions, no-Ticket availability, and composer routing separation from Ticket Intake. - Existing panel/Orchestrator tests still pass.
cargo test -p tui ... --libfor affected tests.cargo fmt --check.git diff --check.target/debug/yoi ticket doctor.
Plan
Delegation intent
Implement workspace-panel-companion-pod-lifecycle in a dedicated worktree.
Worktree:
.worktree/workspace-panel-companion-pod-lifecycle- branch
work/workspace-panel-companion-pod-lifecycle
Coder Pod:
companion-lifecycle-coder-20260607
Key decision to preserve:
- Companion Pod id/name is the workspace directory basename.
- In this repository, the Companion Pod id/name is
yoi. - Do not use
yoi-companionfor the normal workspace Companion. yoi panelshould treat an existing live/restorable default workspace Pod namedyoias the Companion.- Workspace Orchestrator remains distinct, e.g.
yoi-orchestrator.
Scope and boundaries:
- Companion is not a Ticket role; do not route this through
TicketRoleor.yoi/ticket.config.tomlrole slots. - Preserve Ticket Intake as a separate composer target and separate history path.
- Do not reintroduce selected-Pod direct send,
--multi, or:ticket. - Panel close must not stop Companion.
- Existing live
yoiPod may own workspace write scope; lifecycle should reuse/route to it instead of spawning a duplicate with a conflicting scope. - Keep diagnostics bounded and visible.
- Avoid broad UI restructuring.
Requested validation:
- Focused TUI tests for Companion naming/lifecycle decisions and composer routing separation.
- Existing panel/orchestrator tests affected by lifecycle changes.
cargo test -p tui ... --libfor affected tests.cargo fmt --check.git diff --check.target/debug/yoi ticket doctor.
Implementation report
Implementation report
Coder Pod companion-lifecycle-coder-20260607 completed implementation in .worktree/workspace-panel-companion-pod-lifecycle.
Commit:
ba0c9d5 feat: wire panel companion lifecycle
Reported summary:
- Added real workspace Companion Pod lifecycle for
yoi panel.- Companion Pod name is resolved from workspace basename, with no
-companionsuffix. - Live Pods are reused, restorable Pods are restored, missing Pods are spawned through normal default/Companion profile startup.
- Panel close does not stop Companion.
- Companion Pod name is resolved from workspace basename, with no
- Wired
Companioncomposer submit to the workspace Companion Pod viaMethod::Run.- It no longer routes to arbitrary selected Pods.
- Empty composer behavior still preserves selected-Pod open/attach behavior.
- Busy/unavailable Companion states keep the draft and surface bounded diagnostics.
- Kept Ticket Intake separate.
- Ticket Intake target still launches Intake handoff and does not append to Companion history.
- Added focused tests for Companion naming, lifecycle decisions, no-Ticket Companion availability, composer routing, and Intake separation.
Changed files:
crates/tui/src/multi_pod.rscrates/tui/src/workspace_panel.rs
Reported validation:
cargo test -p tui companion --libcargo test -p tui multi_pod --libcargo test -p tui workspace_panel --libcargo test -p tui --libcargo fmt --checkgit diff --checknix build .#yoiresult/bin/yoi ticket doctor
Caveat:
target/debug/yoiwas not used forticket doctor; coder used the Nix-builtresult/bin/yoiafternix build .#yoi.
External review will be delegated before merge.
Review: approve
Approved by companion-lifecycle-reviewer-20260607.
No review-blocking issues were found in ba0c9d5 against develop.
Evidence:
- Companion naming is the workspace basename, with no
-companionsuffix; this repository resolves toyoi. - Live/restorable/missing Companion lifecycle is distinct from Orchestrator lifecycle and does not depend on Ticket config gating.
- Missing Companion spawn/restore uses ordinary Pod startup rather than Ticket role launch; Orchestrator remains the only changed path using
TicketRole::Orchestrator. - Panel close does not stop Companion.
- Non-empty Companion composer submit targets the workspace Companion Pod from panel header state, not the selected Pod.
- Ticket Intake remains separate and builds an Intake launch request with
TicketRole::Intake; it does not send to Companion history. - Companion is not modeled as a Ticket role.
- No
--multi,:ticket, or selected-Pod direct-send route was reintroduced.
Reviewer validation:
cargo test -p tui companion --libcargo test -p tui multi_pod --libcargo test -p tui workspace_panel --libcargo test -p tui --libcargo fmt --checkgit diff --check develop...HEADnix build .#yoiresult/bin/yoi ticket doctor
Worktree status was clean after validation, and the diff is limited to crates/tui/src/multi_pod.rs and crates/tui/src/workspace_panel.rs.
State changed
Ticket closed; workflow_state set to done.
Closed
Implemented, reviewed, merged, and validated.
Summary:
- Added a real workspace Companion Pod lifecycle for
yoi panel. - Companion Pod id/name is resolved from the workspace directory basename; for this repository it is exactly
yoi. - No
-companionsuffix or separate companion-specific id was introduced for the normal workspace Companion. - The panel reuses live Companion Pods and restores restorable Companion Pods before spawning a missing Companion.
- The workspace Orchestrator remains a separate identity such as
yoi-orchestrator. - Panel close does not stop the Companion.
- The
Companioncomposer target now sends user text to the workspace Companion Pod throughMethod::Run, not to arbitrary selected Pods. - Empty composer behavior still preserves selected-Pod open/attach behavior.
- Busy/unavailable Companion states preserve the draft and surface bounded diagnostics.
- Ticket Intake remains separate and does not append Intake text to Companion history.
- Companion is not modeled as a Ticket role and does not use
.yoi/ticket.config.tomlrole slots. - No selected-Pod direct send,
--multi, or:ticketsurface was reintroduced.
Implementation:
- Child commit:
ba0c9d5 feat: wire panel companion lifecycle - Merge commit:
merge: companion pod lifecycle
Review:
- External reviewer
companion-lifecycle-reviewer-20260607approved with no blockers.
Validation after merge:
cargo test -p tui companion --libcargo test -p tui multi_pod --libcargo test -p tui workspace_panel --libcargo test -p tui --libcargo fmt --checkgit diff --checktarget/debug/yoi ticket doctor