From 3fdf07f77eb6b3ee4cc197aa0b091197b830bf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20M=2E=20Wo=C5=BAniak?= Date: Tue, 17 Nov 2026 09:34:27 +0100 Subject: [PATCH] Adopt pinned, delegatedFrom, lastRunError, and scheduledTaskId in the adapter Map pinned chats to pinned: true, list the user's own chats with includeSubagents: false, read one schedule by scheduledTaskId, and report lastRunError on a failed test run. Bump to 0.15.1. --- .claude-plugin/marketplace.json | 2 +- package.json | 2 +- plugins/pstack/.claude-plugin/plugin.json | 2 +- plugins/pstack/.codex-plugin/plugin.json | 2 +- plugins/pstack/skills/poteto-mode/references/t3-adapter.md | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 0338e34..4b697f0 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -9,7 +9,7 @@ "name": "pstack", "source": "./plugins/pstack", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", - "version": "0.15.0", + "version": "0.15.1", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" }, diff --git a/package.json b/package.json index 9288fcc..f7e767f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "t3-pstack", - "version": "0.15.0", + "version": "0.15.1", "private": true, "type": "module", "scripts": { diff --git a/plugins/pstack/.claude-plugin/plugin.json b/plugins/pstack/.claude-plugin/plugin.json index ebf0057..5b5f824 100644 --- a/plugins/pstack/.claude-plugin/plugin.json +++ b/plugins/pstack/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "pstack", "displayName": "pstack", - "version": "0.15.0", + "version": "0.15.1", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" diff --git a/plugins/pstack/.codex-plugin/plugin.json b/plugins/pstack/.codex-plugin/plugin.json index d8a9cb6..b41c851 100644 --- a/plugins/pstack/.codex-plugin/plugin.json +++ b/plugins/pstack/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "pstack", - "version": "0.15.0", + "version": "0.15.1", "description": "Cursor pstack for T3 Code: poteto-mode, principles, and the verified agent workflows, adapted to T3 orchestration for Claude and Codex.", "author": { "name": "Lauren Tan (pstack), pmwoz (T3 Code port)" diff --git a/plugins/pstack/skills/poteto-mode/references/t3-adapter.md b/plugins/pstack/skills/poteto-mode/references/t3-adapter.md index 8b73a85..b35e5e9 100644 --- a/plugins/pstack/skills/poteto-mode/references/t3-adapter.md +++ b/plugins/pstack/skills/poteto-mode/references/t3-adapter.md @@ -95,7 +95,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or - **A PR owner (autopilot, multi-phase plans)** is a role, not a long-lived agent. Each owner round (build, fix, merge) is a fresh `delegate_task` in that PR's worktree. The round does its work, reports the PR URL, head SHA, and state, and returns. The root decides and delegates the next round. - **Babysit inside a child.** A child told to babysit does one `check` pass, fixes what it can, and returns the PR state. It never arms a watch. - **`/loop` around a PR.** This covers babysit's `drive` mode, shipping, and autonomous-run events. The root calls `watch_pull_request` and ends the turn. T3 wakes it on checks, reviews, and conflicts. On each wake, take the verdict from `/skills/poteto-mode/scripts/watch-pr/watch-pr --status-only --pr `, run in the PR's checkout (or the playbook's `origin` or `gh pr view` read), act, and keep the watch armed across push waves. Call `unwatch_pull_request` before handing back to the user. `scripts/watch-pr` stays the verdict oracle. -- **`/loop` on a fixed cadence** (`/loop 1h`, audit ticks, heartbeats). The root calls `schedule_task` with `{type: "interval", everyMs: 3600000}` bound to its own thread, reports `nextRunAt`, and calls `delete_scheduled_task` when the run closes. Schedule from the root, because a child's schedule posts into the child's thread. +- **`/loop` on a fixed cadence** (`/loop 1h`, audit ticks, heartbeats). The root calls `schedule_task` with `{type: "interval", everyMs: 3600000}` bound to its own thread, reports `nextRunAt`, and calls `delete_scheduled_task` when the run closes. To read that schedule again, such as on session pickup, call `list_scheduled_tasks` with its `scheduledTaskId`. Schedule from the root, because a child's schedule posts into the child's thread. - **`/loop until X`** with no outside event: keep iterating within the run. Add a schedule only when the work must survive turn ends. - **Events a PR watch cannot see.** T3 refuses to watch a PR that is already merged or whose host it cannot read, such as when `gh` is missing or signed out, and it cannot watch a ref, a branch without a PR, or a post-merge CI run. On Claude, wait on an event that a command can wait for, such as a post-merge CI run (`gh run watch --exit-status`) or a deploy (its CLI's wait command), by running that command as a long shell command (Claude item below). For an event no command waits on (an autonomous run waiting on a ref), on Codex, and for a heartbeat fallback, the root calls `schedule_task` with an interval bound to its own thread. When the event has a known time, such as a release window or a deploy ETA, use `{type: "once", runAt}` with an ISO time and offset instead, so the root wakes once at that time. The prompt states the check and the exit condition. Call `delete_scheduled_task` once the condition holds. - **Long shell commands on Claude.** Run a long command, such as a gate, a test suite, or a build, with `run_in_background` and end the turn. Its exit wakes you, and so does each delegated task that finishes. Before you end the turn, call `t3_background_wait` with `taskIds: [""]`, where the id is the one that Claude Code shows when the command starts. It takes shell task ids only. A `delegate_task` task id never matches, and a delegated task wakes you on its own. The result lists each id under `matched` or `unmatched`. An unmatched id marks nothing, so check that it is the id of a command that still runs. The thread then stays in the user's Working list instead of their inbox, T3 does not settle it while the command runs, and a T3 restart that kills the command wakes you with a note. Mark only a command whose result you will act on, never a dev server or a watcher you leave running. Do not wait in a foreground loop while children run, because a child's completion can stay queued until your turn ends. A command you start with `run_in_background` already wakes you when it exits, so do not add a waiter loop for it. Use an `until [ -s x.exit ]` loop, itself run with `run_in_background`, only for an exit file that a process you did not start that way writes. A foreground call stops at 600000 ms whatever its `timeout`. The pstack hook blocks a foreground `until` or `while` loop that sleeps. @@ -108,7 +108,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or - **Earlier chats** (recall, session pickup, show-me-your-work audits). Use `t3_thread_search` and `t3_thread_list` in this project only. `t3_thread_search` returns title, branch, and PR matches first. A message match needs every query word of three or more characters and carries `source` (`user` or `assistant`), a `snippet`, and `messageCreatedAt`, so pick threads from the snippets before you read them. Message matches fill at most a fifth of `limit`, so pass `limit: 50`, the maximum, when you look for message content. Search skips subagent threads. Drop the match whose `threadId` equals the result's `currentThreadId`, which is your own thread. Pass thread ids to children, not file paths. Page a thread the way the description of `t3_thread_read` in your session says, because the cursor parameters and the order of a read without a cursor differ between T3 builds. Read a long thread in pages of `limit: 20` with `maxCharsPerItem: 2000`, and recover a long item with `itemId` and `textOffset`. T3 ends a page at about 30,000 characters and reports the rest through `hasMore` or `earlierPosition`. On Codex, never print a raw `t3_thread_read` result. Keep it in a variable and print what you need, such as each item's `position`, `type`, and first 300 characters. Cite a thread by the `link` a thread tool returned, verbatim, never by a title or a bare id. With only an id, `t3_thread_read` returns its `link`. - **Messages from other threads.** A `t3_thread_read` item with `senderThreadId` is a message that thread sent with `t3_thread_send`, such as a parent's follow-up. The user did not type it, so do not read it as the user's words. - **Shell fallback.** `~/.claude/projects//*.jsonl` (Claude) and `~/.codex/sessions/**/*.jsonl` (Codex). -- **Pinned and active chats** ("from the user or the sidebar") are the threads `t3_thread_list` returns with `settled: false`. Add `allProjects: true` when the work spans repositories, such as a disk cleanup. +- **Pinned and active chats** ("from the user or the sidebar") are the threads `t3_thread_list` returns with `pinned: true` or `settled: false`, called with `includeSubagents: false`. That leaves out child tasks and the tasks a linked environment delegated here, which `delegatedFrom` marks in any list or read. A child task of a pinned or active chat is in use too, and its `parentThreadId` names that chat. Add `allProjects: true` when the work spans repositories, such as a disk cleanup. ## Locations @@ -132,7 +132,7 @@ T3 has no cloud agents. Every lane is a `delegate_task` child on this machine or - **Custom Mode, Option+Enter.** None. Start a task with `/pstack:poteto-mode` (Claude) or `$pstack:poteto-mode` (Codex). On Claude, T3's composer also offers pstack's skills in its `$` picker when the plugin is enabled in Claude Code, and sends the pick as `/pstack:`. - **Cursor's built-in `/babysit` and `/autopilot` PR watchers.** Not present. The Babysit playbook is the only PR watcher. The Autopilot playbooks are pstack's own, not this built-in. - **Plan Mode.** T3 interaction mode `plan`. -- **Automations** (`automations/benny`). A webhook or fixed-time `schedule_task`. Each run handles one event. A run that only reads and replies, such as benny's triage, is created with `bindToCurrentThread: false` and `freshSession: true`: the first run makes the automation's thread in a new worktree, and every later run posts there in a fresh session without earlier runs' context. A run that changes code or opens a PR, such as benny's reproduce automation, takes only `bindToCurrentThread: false`, so each run gets its own thread and a fresh worktree from the default branch. With neither set, a task in the creating thread's own project binds to that thread, and every run continues that conversation. A task for another project then gets a new thread per run. Get webhook signing secrets with `request_secret`. Put the trigger's conditions in the webhook schedule's `filters`, so other requests never start a run. For benny, `body.event.channel` equals the source channel. A path segment ending in `[]` checks each element of an array. `{path: "body.issue.labels[].name", op: "equals", value: "