Repository navigation
Commit e19c81a
orchestrator: slack threads as an agent with one way in (phase 2) (#1695)
* fix(orchestrator): a neutral session end closes the relay in silence
A session that ends without a result (the sandbox reclaimed, a kept
session swept after its retention) used to post a neutral close into its
relay target. With the relay bound to the session, a kept Slack thread
session is swept long after the conversation ended, and the thread heard
about it. Now only a completed or failed session posts; a neutral end
removes the relay row and says nothing.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* feat(orchestrator): slack threads on short runs with run_agent
The Slack built-in was the one automation that held a run open for the
length of a conversation: nested loops over wait_event and wait_session
slices, a 48 h deadline, and the join policy to feed replies into the
run. Definition 14 makes every mention one short run:
- facts, admit, identity and the linked check stay as they were;
- `previous` looks up the thread's kept session (the thread is the
workstream), `replies` lists the thread, and `turn` folds the replies
written since the previous turn into the mention's text;
- behind the has-text gate, smart routing runs only for a thread with no
session, then `run_agent` continues the kept session or starts one and
points the session's relay at the thread, and a new session posts its
link;
- a failed run closes the relay with the failure; a completed run leaves
the relay to the session, which posts on its own with no run live.
`idle_timeout` and `max_turns` go: nothing waits, so nothing times out
or counts turns. The queue policy keeps a thread's turns in order.
`walkBlocks` is exported for the definition tests. The interpreter test
drives the new graph end to end: first mention, continued thread, bare
mention, unlinked author, smart routing with and without a decision,
and the queue of two mentions on one thread.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(orchestrator): a built-in bump drops inputs the shipped schema retired
The seed merged an org's stored inputs with the defaults of new keys and
kept every stored key. A key the shipped schema no longer declares held
a value for a graph that is gone, and the Inputs tab showed it with no
field to edit. Now the merge keeps only the keys the shipped schema
declares, then fills in defaults for the new ones.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* docs(site): slack threads as one short run per mention
The Slack threads pages described a run that stays open until the
thread goes quiet, the idle timeout and turn limit inputs, and the join
policy. They now describe the short-run model: a mention is a run, the
thread's session is kept, the replies since the previous turn go with
the next mention, and the session relays on its own.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* feat(orchestrator): slack threads as an agent with one way in
The built-in's agent moves out of the block list into the definition's
`agent`: scope per thread (the key and label templates that were
settings.instance), the profile from smart routing's verdict or the
facts, the turn as the prompt, the relay into the thread. The way in's
blocks admit the mention, fold the thread, gate a bare mention (now a
filter: the run ends filtered, nothing is posted), and route a new
session; the engine's agent step ends the run.
The started-session block goes: the agent step announces a session it
starts through the relay's policy. Smart routing's verdict, when nobody
was asked, is posted as a line of its own, so the thread still says
which profile answers and why. Definition version 15.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* feat(orchestrator): the relay records its place as the workstream's handle, and the lookup says where it points
Two seams the Slack built-in needs now that its "Started a session"
post is gone.
- That post recorded the thread as the workstream's handle through the
action runtime; without it the handle ledger never learned the thread
and the UI had no place to name the workstream by. Installing or
re-pointing a relay on a run bound to a workstream now records
`slack:<channel>:<thread>` for it (idempotent; a conflict is reported
on the step, never a rebind, never a failed turn).
- `lookup_instance_session` outputs `mention_ts`, the mention the kept
session's relay points at: the boundary of what the session has seen,
which the fold needs instead of guessing it from the thread page.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(orchestrator): slack threads, the review's findings
- The seed's content hash and its stored view left out the agent and
the role, so a change to the agent never bumped the built-in, and a
stored agent automation hashed as if it had none. Both carry them.
- The failed hook closed the thread's live relay (`relay_close`) when a
run failed before it reached the agent step, which the queue makes
the common failure shape. The hook posts one line that says why; the
session keeps its relay and the next mention is a new turn on it.
- The fold found the previous turn by scanning the thread page for the
newest human mention of the bot, so a mention admission dropped (an
unlinked author) moved the boundary and its text was lost. The fold
starts at the mention the session's relay points at, with the page
scan as the fallback.
- The thread page read was unbounded (capped by the API at 500), so a
long thread pushed the new messages off the page. A continued session
reads from its previous turn on (`oldest`).
- The hand-written `queue` concurrency goes: the engine derives it from
the kept scope.
- A stale comment in the overrides test named a session-link post that
no longer exists.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(orchestrator): a built-in bump stops the runs of the version it replaces
The Slack threads built-in moves from one long run per thread (a loop
parked on a wait, holding the thread's session and a concurrency claim
of its own) to one short run per mention. A thread whose old-version run
was still parked when the bump landed could not go on: the next mention's
run, under the new version's derived concurrency, found the kept session
owned by the live old run, and the turn failed.
The seed now stops the runs of the version a bump replaces, with a reason
that says why. Their kept sessions stay (the old definition keeps them),
the binding's owner is over, and the next event's run of the new version
continues the session. The store lists an automation's runs that are not
over; the seed's production deps send the stop through the run inbox.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XkqDsk7JzXh98cpgnJJ9w
* test(orchestrator): the Slack thread harness answers the open check
The agent step asks whether the workstream is still open before it starts
a session; the thread harness says yes.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XkqDsk7JzXh98cpgnJJ9w
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>1 parent 508c2b0 commit e19c81a
17 files changed
Lines changed: 729 additions & 941 deletions
File tree
- orchestrator/src
- __tests__
- automations
- builtins
- __tests__
- engine
- __tests__
- blocks
- db
- site/src/content/docs/docs
- guides
- platform
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
270 | 276 | | |
271 | 277 | | |
272 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
117 | 128 | | |
118 | | - | |
| 129 | + | |
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
| |||
213 | 224 | | |
214 | 225 | | |
215 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
216 | 258 | | |
217 | 259 | | |
218 | 260 | | |
219 | 261 | | |
220 | 262 | | |
221 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
222 | 271 | | |
223 | 272 | | |
224 | 273 | | |
| |||
0 commit comments