Repository navigation
Description
Problem
Agents currently have to poll, spend turns sleeping, or ask the user to relay
completion when they start a process that outlives the current turn. LastCode
already owns configured Actions, thread identity, provider sessions, terminals,
and terminal-exit events, but it does not bridge one addressed Action result
back into the originating thread.
This feature should prove that bridge with one narrow, useful tracer before
introducing a general task or orchestration framework.
Proposed delivery
Slice 1: Quick-CI exit tracer
Add a local, per-Action setting, default off:
Allow this Action to resume agent threads
The permission is local LastCode state. A checked-in or imported t3.json
cannot enable it. Enabling it makes the Action eligible; it does not make normal
UI clicks or arbitrary terminal exits resume threads.
An agent explicitly invokes one dedicated, resume-capable LastCode MCP tool for
one configured Action. LastCode:
- derives the originating thread and provider session from the authenticated
MCP invocation; - opens a dedicated thread-scoped terminal and attaches its exit listener
before launching the configured command; - returns an arming receipt immediately and instructs the agent to finish
its current turn; and - after the Action reaches a terminal state and the thread is idle, starts
exactly one follow-up turn on that same thread.
The arming receipt is a structured acknowledgement containing a server-generated
run ID, the wake condition, and the first-cut durability boundary. armed
describes the one-shot wake registration, not whether the process is still
running. It is not a polling handle, and the MCP surface supplies no wait or
status-poll operation.
The automated follow-up must be represented as LastCode machine activity, not
as a fake human message. Provider input contains only fixed LastCode-authored
control text, server-generated identifiers, and validated status values.
Output handoff
On exit, LastCode finalizes a bounded output artifact under T3 home in a
server-generated thread/run directory. The artifact contains a size-limited
suffix of terminal output after replay-unsafe control sequences are removed.
The wake supplies an artifact descriptor with its path, byte and line counts,
completion state, and truncation state, plus the exit code or signal and
duration.
No terminal output or generic last-line preview is inserted into the automatic
provider input. The resumed agent decides whether and how much of the completed
file to read. Its contents remain untrusted data.
The current Action terminal is a PTY and exposes a combined output stream. One
combined artifact is sufficient for the tracer. Separate stdout and stderr
artifacts would require a runner that pipes and tees both child streams back
into the visible terminal and are not required for this slice.
Retain artifacts through thread archive because archive is reversible. Delete
them with permanent thread deletion. Archived threads must not be resumed
automatically; the exact treatment of an Action still running when its thread
is archived must be fixed before implementation.
Slice 2: restart durability
The first tracer may truthfully report durability: current_lastcode_process.
A LastCode restart may terminate the Action and lose its in-memory wake
registration; persisted terminal evidence and a manual user resume are the
initial recovery.
The required second cut makes Action execution and its wake durable across a
full LastCode restart. Its finite test is:
- start an Action and finish the originating turn;
- restart LastCode while the Action is running;
- verify that the Action continues;
- recover a completion that occurs during or after the restart; and
- resume the originating thread exactly once when it is eligible.
Choose the smallest reattachable process-ownership and persisted-correlation
model that passes this test. Do not use this requirement to build a general
scheduler.
Slice 3: retention controls
Because archived threads may remain indefinitely, LastCode Settings should
report the count and disk use of completed Action artifacts and provide an
explicit cleanup command for artifacts belonging to archived threads. Cleanup
excludes running Actions and pending wakes and warns that an unarchived thread
will no longer have those logs.
An optional automatic retention policy may follow and defaults off. It is not a
prerequisite for the Quick-CI tracer.
Acceptance criteria
- One real, locally opted-in Quick CI Action runs in a real LastCode-hosted
terminal. - The originating agent turn ends before the Action finishes and consumes no
polling turns while waiting. - The Action's terminal result and idle-thread state produce exactly one
follow-up turn on the originating thread. - Ordinary Action clicks, unrelated terminals, and Actions without the local
permission never arm a wake. - The arming receipt and visible machine activity truthfully distinguish the
automated source from a human message. - Automatic provider input contains structured result metadata and an artifact
descriptor, not terminal output. - The output artifact is readable on demand, bounded, marked as untrusted, and
retained through archive until explicit cleanup or permanent thread deletion. - The first-cut restart limitation is visible and recoverable; the second-cut
restart test above subsequently passes. - LastCode Settings eventually exposes artifact size and safe manual cleanup.
Explicit non-goals
- A general task database, scheduler, or orchestration framework.
- Arbitrary-command adoption or waking on every terminal exit.
- Polling-based MCP Tasks emulation.
- Readiness and input-required protocols, development-loop supervision, or
Markover feedback wakeups in the first tracer. - Provider-neutral adapter machinery before the Codex-backed tracer proves the
process-to-thread seam. - Separate stdout/stderr capture in the first slice.
MCP Tasks remains a later compatibility target when relevant hosts expose the
extension; the local tracer does not depend on host Tasks support.
Activity
lastobelus commentedon Aug 17, 2026
Work intent
feat(lastcode): resume agents after opted-in Actions (#28)
lastobelus commentedon Aug 17, 2026
Slice 2 work intent
lastcode/action-resume-mobileThis remains a deliberately small, temporary, single-user-first implementation pending the V2 orchestrator.
feat(lastcode): add mobile Action resume controls (#29)
lastobelus commentedon Aug 17, 2026
Completed in #28 and #29. Slice 1 delivered the scoped Action-resume tracer and desktop/web lifecycle; slice 2 added the mobile Waiting, cancellation, and interrupted-run recovery controls.
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
76 remaining items
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
feat(lastcode): resume agents after opted-in Actions (#28)
feat(lastcode): add mobile Action resume controls (#29)
lastobelus commentedon Sep 28, 2026
Closure clarification: this issue should remain closed as the delivered, scoped one-shot Action-resume tracer, implemented in #28 (web/desktop and server lifecycle) and #29 (mobile controls), both merged on August 17.
The accepted work-intent comment narrowed the original proposal: one resumable Action per thread, a same-thread follow-up after completion, cancellation, and explicit interrupted-run recovery. It explicitly excluded process survival/automatic wake delivery across a restart, concurrency, and aggregate artifact retention controls. The later comment's “slice 2” meant mobile controls; it did not implement the original body's “slice 2: restart durability.” Closure should not be read as claiming that restart-survival test or the original retention-controls proposal passed. Those remain separate outstanding scope; they are not silently waived by this clarification.
The next direction is complementary work on (1) independent concurrent Action runs with serialized, durable follow-up delivery to the originating thread and (2) multi-condition Action tooling, initially with an explicit completion policy and one final report preserving each condition's outcome. PR #222 addresses sequential stacked-PR waits and does not implement either general concurrency or multi-condition observation.
Intermediate actionable results that wake the thread while the Action continues waiting are a possible later enhancement. Keep execution state separate from delivery state so this remains possible, but intermediate-event behavior and any acknowledgment/response protocol still need design. They are not part of the completed tracer or a claim of current functionality.