Repository navigation
Commit 78fd037
authored
feat: tower wake steering, prompt hook folding, WaitFor cap, sticky fullscreen messages (#339)
## Requirement or Bug
Land a batch of agent-experience behavior changes: tower wake steering
and safer tower operations, prompt hook-output folding, a shorter
WaitFor cap, and sticky fullscreen user messages.
## Bug Reproduction Steps
N/A
## Root Cause
N/A
## Code Changes
- **Engine** (`packages/agent-core-v2`): `WaitFor` caps at 90 seconds
and a newly sent message ends the wait early; `UserPromptSubmit` hook
output folds into the prompt message as meta-marked content parts
(annotate-then-filter keeps legacy wires readable); tower wake turns
abort on user input; tower teardown gains keep-live worktrees,
`exclude`, and `dry_run`; the tower store serializes across processes
and writes atomically; tower workers must check their inbox before
completing a mission.
- **Transcript / gateway**: transcript grouping and cold-load mode state
follow the folded parts; prompts API exposes the folded shape.
- **TUI** (`apps/pythinker-code`): sticky user message pinned above the
transcript in fullscreen (`TranscriptView` + gutter pill + layout
effects in the vendored TUI); wait renderer gains an "interrupted"
state; user message bullet is now `❯` with wrap-aware line heights.
- **VS Code**: replay adapter and hook-part helpers understand the
folded parts.
## Behavior Changes and Affected Users
| Behavior | Before | After | Who relies on the old behavior | Escape
hatch |
|---|---|---|---|---|
| `WaitFor` timeout cap | up to 600s | capped at 90s | agents (or
scripts prompting agents) that issued multi-minute waits | none — the
changeset names the cap |
| Ending a `WaitFor` wait early | `Ctrl-S` only | sending a message with
`Enter` also steers it in and ends the wait; queued shell commands or
skills keep the queue until the turn ends | users who queued commands
expecting the agent to stay waiting | none; queued non-message work
still waits |
| Tower wake turns | a message sent during a wake turn queued behind it
| the message aborts the wake turn and runs as its own turn | tower
users relying on undisturbed wake turns | tower mode is experimental
(`[experimental] tower = true`) |
| Tower teardown | forced teardown could remove worktrees of live agents
| keeps worktrees of live agents even when forced; supports `exclude`
and `dry_run` | tower users scripting teardown | the new options control
the behavior |
| User message bullet | `✨` | `❯` | users matching the old glyph in
scripts or themes | themes and keybindings unaffected; the glyph only
changes rendered output |
| Hook output in the transcript | standalone `hook_result` user message
| folded into the prompt message as marked content parts (one prompt =
one user message) | transcript consumers: SDK callers, desktop/web
replay, VS Code adapter — updated in the same change; external raw-wire
parsers see meta-marked parts | none |
Affected modules and coverage per row: engine wait/hook/tower changes
carry unit and contract tests (`test/agent/loop`, `test/agent/task`,
`test/features/tower`, `test/features/externalHooks`); transcript
folding is covered by the `packages/transcript` and gateway
transcript/prompt suites; TUI behavior by component and message-flow
tests; VS Code by replay-adapter tests.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: the issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] The behavior-change table above is complete, and every removed
behavior or flipped default is named in the changeset and either has an
escape hatch or was explicitly approved by a maintainer in this PR.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.1 parent 7fe5adf commit 78fd037
107 files changed
Lines changed: 5615 additions & 1289 deletions
File tree
- .agents/skills
- gen-changesets
- review-pr
- write-pr
- .changeset
- .github
- apps
- pythinker-code
- dist-web
- src/tui
- components
- chrome
- messages
- tool-renderers
- constant
- controllers
- utils
- test/tui
- components
- chrome
- messages
- controllers
- utils
- vscode
- src
- runtime
- utils
- test
- docs
- guides
- reference
- packages
- agent-core-v2
- docs
- src
- agent
- contextMemory
- loop
- tools/task/task-wait
- undo
- features
- externalHooks
- agent
- internal
- skill
- tower
- injection
- protocol
- tools
- inbox
- mission
- spawn
- status
- teardown
- human
- agent
- llm
- test/agent
- session/sessionTitle
- workspace/sessionLifecycle/internal
- test
- agent
- contextMemory
- loop
- prompt
- task
- tools
- undo
- features
- externalHooks
- goal
- tower
- tools
- agent-gateway
- src
- routes
- services/transcript
- test
- services
- pi-tui
- src
- test
- transcript
- src/history
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 | | |
11 | 20 | | |
12 | 21 | | |
13 | | - | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | | - | |
| 28 | + | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
25 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
26 | 72 | | |
27 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
28 | 76 | | |
29 | | - | |
| 77 | + | |
30 | 78 | | |
31 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
32 | 88 | | |
33 | | - | |
| 89 | + | |
34 | 90 | | |
35 | | - | |
36 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
37 | 94 | | |
38 | | - | |
| 95 | + | |
39 | 96 | | |
40 | | - | |
41 | | - | |
| 97 | + | |
| 98 | + | |
42 | 99 | | |
43 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
44 | 107 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 108 | + | |
| 109 | + | |
48 | 110 | | |
49 | | - | |
| 111 | + | |
| 112 | + | |
50 | 113 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 114 | + | |
55 | 115 | | |
56 | | - | |
| 116 | + | |
57 | 117 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
61 | 125 | | |
62 | | - | |
| 126 | + | |
63 | 127 | | |
64 | | - | |
65 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
66 | 163 | | |
67 | 164 | | |
68 | 165 | | |
69 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
70 | 197 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 198 | + | |
| 199 | + | |
0 commit comments