Skip to content

Repeat a finished thread: schedule its prompt or distill it into a workflow (#285) - #379

Merged
currentbits merged 9 commits into
mainfrom
coder/turn-any-finished-thread-into-an-automat-505ae1
Aug 17, 2026
Merged

currentbits merged 9 commits into
mainfrom
coder/turn-any-finished-thread-into-an-automat-505ae1

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #285.

Most automations start life as a one-off run that worked. This adds the on-ramp: two actions in the thread header overflow menu, both hidden while a run is live.

Schedule this prompt…

Seeds the Automations create form from the open thread — its first non-empty user message as the prompt, plus the thread's project, provider and model. The user picks a preset and hits create; every field stays editable. No backend work: the automations scheduler already handled everything past that point.

  • src/repeatThread.ts — RepeatDraft + repeatDraftFromDetail (first user message; later ones are follow-ups that only make sense mid-conversation)
  • AutomationsView takes an optional draft prop that prefills the form
  • ThreadView menu item → App state → automations view

Distill into workflow…

New runs:distill handler (electron/distill.js) reads a finished thread's transcript and distills it into a 2–4 phase workflow template draft. Nothing is persisted: the draft opens unsaved in the existing workflows editor for review, and saving goes through the existing workflows.save. Phases always inherit the thread's own provider/model.

Summarisation uses the local macOS fm CLI (electron/fm.js, same pattern as fm-title.js). When fm is missing, times out, or returns junk, it falls back to a deterministic single repeat phase seeded from the first prompt — a distill call never rejects just because the local model is absent.

Known limit: fm is not installed on this machine, so distill currently produces that fallback here. Real summarisation only kicks in where the macOS 27 fm CLI exists; a paid-provider distill path is the upgrade if that turns out to matter.

Not in scope

#275's parameterised, shareable bundle format. The distilled output is a plain workflow template, which is what the app has today.

Verification

  • npm run typecheck — clean
  • npm run test:renderer — green
  • npm run test:electron — 1031 pass; 3 suites fail (orch-server HTTP, orch-server provider injection, wireClient × webBridge). All three also fail at the pre-merge baseline in this worktree — they need real sockets.
  • Dogfooded read-only against a copy of the live store: distill on real finished threads returns a valid save-ready draft on the fallback path.

Built by two parallel workers on a shared contract commit (renderer / main process, disjoint file sets). Both landed a distill IPC channel; the threads:distill duplicate was cut in favour of runs:distill, which is where the CoderApi type and the renderer call it.

🤖 Generated with Claude Code

  • PR created by the Claude Code agent

Willem and others added 8 commits August 17, 2026 20:42
Wires git:conflictForecast end to end with a stub implementation so the
backend and UI can be built in parallel against a fixed shape.

Co-Authored-By: Claude Opus 5 <[email protected]>
… Skill manager: install once, fan out to every provider's ski
… Use macOS 27's fm CLI as a free local LLM for housekeeping
Shared surface for the two halves of one-click recurrence:
- src/repeatThread.ts: RepeatDraft + repeatDraftFromDetail (first user message)
- ipc.ts: DistilledWorkflow + threads.distill declaration

Co-Authored-By: Claude Opus 5 <[email protected]>
Main-process half: electron/distill.js reads the transcript, asks fm
for 2-4 reusable phases, and falls back to a single phase from the
first user prompt when fm is missing or returns junk. Nothing is saved.

Exposes threads.distill and runs.distill (contract put it on runs;
the renderer calls it on threads).
On a finished thread, the overflow menu now offers Schedule this prompt
(prefill AutomationsView from the first user message) and Distill into
workflow (runs.distill, then open WorkflowsModal as a new unsaved draft).
…into coder/turn-any-finished-thread-into-an-automat-505ae1
Both halves landed a channel each; the CoderApi type and the renderer use
runs.distill, so the threads:distill duplicate goes.

Co-Authored-By: Claude Opus 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…ed-thread-into-an-automat-505ae1

# Conflicts:
#	electron/worktrees.js
#	src/App.tsx
@currentbits
currentbits merged commit 462e6df into main Aug 17, 2026
1 check failed
@currentbits
currentbits deleted the coder/turn-any-finished-thread-into-an-automat-505ae1 branch October 3, 2026 16:07
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.

Turn any finished thread into an automation (one-click recurrence)

1 participant