Repository navigation
Description
I’d like to revisit WorkHub’s overall architecture. My concern is that the design has accumulated enough special rules that it is becoming difficult to understand how an ordinary request is handled, which settings apply, and why some interactions need their own protocols.
I appreciate the work that has gone into reliable delegation, recovery, and the desktop experience. Looking at the complete flow, though, I think the current design asks too much of both users and maintainers. I would like to discuss a coherent simplification before extending it further.
The original goal and how the design evolved
The original goal in #3286 was to give users one conversational place to advance their work without manually managing Session routing.
In my early proposal, I described a persistent main agent coordinating existing Sessions, with execution details secondary to the conversation. The accepted per-Host design established useful boundaries: the coordinating Session owns its conversation, while target Sessions own execution and recovery.
The early discussion already included bounded routing, clarification, and independent Session permissions. Later updates explicitly added more routing stages and linked-operation contracts. I also supported parts of that direction, as I acknowledged here.
This is a proposal to reconsider the accumulated design. Individual additions may have had reasonable motivations, but their combined complexity now seems disproportionate to the original product goal.
Why leaving the design as it is has a cost
Configuration makes behavior difficult to predict. There are separate settings for the coordinating Session, defaults for newly created tasks, and existing Sessions being reused. The model picker in the WorkHub composer changes future-task defaults rather than the model answering the current conversation. Those defaults are currently held in memory per Host. Delegation can also open a model-repair form for a target Session. A user should be able to understand what a model selection controls without learning these internal scopes. Current picker behavior
Some validation creates work unrelated to the selected task. The candidate-set identity includes names, statuses, and update times across the offered set. An unrelated candidate changing can invalidate delegation to the selected target. This is more than a theoretical concern: #4785 reports an automatic-title race that rejects delegation. That report is evidence of the failure mode, not a measurement of its current production frequency. Keeping this design means callers must keep accommodating refresh-and-retry behavior for changes that may not affect their intended action. Snapshot construction
The optional routing layer adds another decision process to maintain. The default path already lets the main agent use coordination tools. The optional staged path adds Intent, Recall when needed, a stored routing decision, and constraints requiring the main agent to follow that decision. When enabled, it adds serial model calls and associated latency and cost. Maintaining it also means keeping two decision paths, their prompts, failure behavior, and recovery consistent. I would prefer one coordinating agent choosing its actions, with the Host validating the actual target and operation. The additional stages need a demonstrated benefit substantial enough to justify their continued cost. Routing contracts
Changing a task introduces a separate transaction lifecycle. Correction involves replacement requests, cancellation of previous work, replacement-abort records, supersession, and replay rules. That provides a particular guarantee: replacing a delegation involves retiring the previous work first. I would like to revisit whether the product needs that guarantee, or whether Steering and explicit stop-and-delegate operations are sufficient. #4868 already raised this question. Retaining the transaction requires every relevant change to account for its intermediate states and recovery behavior.
Question relaying leaves a worker suspended while synchronizing two interactions. A delegated task can wait inside a question tool while WorkHub presents a copy and forwards the answer. The relay must detect whether the original question has settled, close stale copies, and handle late answers or cancelled tasks. I would prefer WorkHub-initiated tasks to report missing information, continue independent work where possible, and return control to the coordinator. Removing the relay also requires changing how worker-side question calls are handled; deleting the forwarding code alone would leave tasks waiting. Current relay
The cumulative maintenance cost matters too. Adding a coordination operation means considering routing classification, bound decisions, configuration selection, candidate freshness, correction, questions, and recovery together. My concern is that continued additions will make changes harder to review and failures harder to explain. I do not have a measured engineering-time figure or a percentage improvement to claim.
WorkHub’s purpose is to reduce the Session-management burden on users. If using it requires understanding more configuration and control rules than an ordinary Session, it is not fully delivering that benefit.
A simpler coordination model
This diagram compares responsibilities rather than listing every runtime step. Staged routing is optional today, and the WorkHub-specific protocols apply only to relevant actions.
flowchart TB
subgraph current["Current coordination structure"]
direction TB
U["User request"] --> M["Main coordinating Session"]
U -. "Optional staged routing" .-> R["Intent and Recall"]
R --> D["Stored routing decision"]
D --> M
M --> T["WorkHub task tools"]
T --> H["Host admission plus WorkHub-specific protocols"]
H --> S["Target Session"]
S -->|"Results"| M
S -->|"Pending question"| Q["Question relay"]
Q --> M
end
subgraph proposed["Proposed simpler structure"]
direction TB
U2["User request"] --> M2["Main coordinating Session"]
M2 --> T2["Discover, delegate, steer, stop"]
T2 --> H2["Host validates the specific operation"]
H2 --> S2["Target Session"]
S2 -->|"Results or missing information"| M2
end
Concretely, I would like to explore:
- One persistent coordinating Session per Host, using ordinary Session configuration.
- Direct tool-based coordination, without a pre-routing model or a separate bound-decision prompt path.
- Session discovery and reuse, including the current bounded recent-Session lookup.
- Steering and ordinary control operations instead of a dedicated correction transaction.
- A clear model rule: new tasks use shared defaults; existing tasks retain their own configuration. An unavailable model returns an actionable failure rather than starting a WorkHub-specific repair workflow.
- Missing information returned to the main Session instead of cross-Session question relaying.
- Validation of the chosen target without binding the operation to an entire candidate snapshot.
For the first stage, I would also prefer a simple YOLO execution policy. That is a deliberate change from earlier permission assumptions, so its scope—especially when reusing an existing Session—needs explicit agreement.
WorkHub should retain its ability to operate Maka’s interface, use the browser, and read attachments. Host-owned execution, reliable delivery, precise target identity, and protection against stopping unrelated work also remain necessary. Existing conversations and persisted records need deliberate compatibility handling.
I would keep colors and visual identity as a separate discussion. Agreement on those should not be a prerequisite for simplifying coordination.
The outcome I am looking for
I would judge the refactor by whether:
- Users can predict which model and execution settings an action will use.
- Unrelated Session changes stop causing delegation refreshes and retries.
- Missing information is handled through one understandable conversation, without a worker remaining suspended in a relayed question tool.
- Maintainers can change a coordination behavior without updating several parallel decision and state mechanisms.
- Reliable delivery, recovery, and exact-target control still hold.
For any mechanism that needs to remain, what concrete capability or guarantee would disappear without it, and why can’t the existing Session and Host boundaries provide it? I would welcome counterexamples where the simpler model would be insufficient.
I would like to agree on the smallest coherent model first, then use it to guide the refactor. Related tracker: #3492.
I’d especially appreciate input from @ARE404 on the coordination design, @M4n5ter on the WorkHub interaction and browser integration, and @xxhZs on delegated results. Feedback from everyone involved is welcome. Which guarantees would this proposal lose, and which complexity can safely go?
AI assistance: Codex helped inspect the implementation and discussion history and draft this issue.
Activity
ARE404 commentedon Sep 27, 2026
I agree with the direction of exploring a simpler coordination model. Letting the main Agent coordinate by calling tools feels simpler and more AI-native than adding a separate pre-routing model step.
I think a few related boundaries are worth discussing before settling on the concrete model:
I support exploring this direction and would be glad to help work through these questions toward the smallest coherent model.
Astro-Han commentedon Sep 27, 2026
Thanks, @ARE404. Glad we agree on the direction. Here is where I land on the three questions.
1. Where intent and Session resolution live
I don't think there should be a resolver in the tools. The discovery tool returns material: the bounded recent-Session list, plus whatever the model asks for through search. The main agent decides which Session a request belongs to. The Host then checks only safety: the target exists, is not archived, and the caller owns the Turn it is stopping. The Host does not judge whether the target is the right one.
A resolver inside the tool can take one of two forms, and neither works. If it is rules, it is a state machine mapping requests to Sessions, and it will miss every phrasing its authors did not anticipate. If it is another model call, it is a second decision-maker next to the main agent. That brings back the serial latency and the two decision paths this refactor is meant to remove.
There is also a longer history behind this. Expert systems, hand-built dialogue state trackers, and intent/slot-filling pipelines all tried to make decisions on the model's behalf with engineered structure. Each was eventually overtaken by general learned models given more context and compute. Sutton's The Bitter Lesson describes this pattern. Deciding which Session a request belongs to is language understanding, which is exactly what the model is for. If the main agent picks the wrong target, the fix is better context in the tool output (clearer candidate descriptions, recent activity), not a layer that decides for it. If you have a case where the main agent, given the candidate list, picks wrong and a resolver would pick right, please share it. I would treat it as a context gap to fix in the tool.
2. Steering, Stop, and replacement
Changing direction on a delegated task is Steering, the same as telling an ordinary Session "no, refactor it instead". If the target Turn has already ended, the steer becomes the next Turn, which ordinary Sessions already handle. Moving the work to a different Session means stopping by exact Turn id and then delegating. Stopping by exact id means it cannot hit unrelated work. Each of the two steps is an ordinary Host operation with its own recovery, and nothing between them needs recovering. What failure does the replacement transaction prevent that these two steps do not?
3. Models and execution policy
bypassis already the product default, and the sandbox needs to be reworked anyway. There is also a structural reason. A reused Session left onaskwould block on an approval that WorkHub does not relay, which is the same suspended-worker problem as the question relay under another name. The one thing to state openly: if a user explicitly set a Session toask, delegating to it through WorkHub switches it tobypass. That is intentional, and we should say so rather than hide it.If these three hold, I'll update the proposal with the resulting model and start the refactor.
中文
谢谢 @ARE404,很高兴我们在方向上一致。下面是我对这三个问题的看法。
1. 意图识别和 Session 解析放在哪
我认为工具里不应该有 resolver。发现工具只返回材料:有界的最近 Session 列表,加上模型通过搜索要的其他信息。请求属于哪个 Session 由主 Agent 决定。Host 只做安全检查:目标存在、没有被归档、调用方拥有它要停止的那个 Turn。Host 不判断这个目标选得对不对。
工具里的 resolver 只有两种形态,都行不通。如果是规则,它就是一台把请求映射到 Session 的状态机,作者没预料到的说法都会漏掉。如果是再调一次模型,它就是主 Agent 旁边的第二个决策者,串行延迟和两条决策路径又回来了,而这正是这次重构要删掉的东西。
这背后还有更长的历史。专家系统、手工构建的对话状态跟踪器、意图/槽位填充流水线,都试过用人工设计的结构替模型做决策,最终都被拿到更多上下文和算力的通用学习模型超越。Sutton 的 The Bitter Lesson 讲的就是这个规律。判断请求属于哪个 Session 是语言理解问题,而这正是模型擅长的事。如果主 Agent 选错了目标,修法是在工具输出里给更好的上下文(更清楚的候选描述、最近活动),而不是加一层替它做决定。如果你有这样的例子:主 Agent 拿到候选列表后选错,而 resolver 能选对,请贴出来,我会把它当作工具要补的上下文缺口。
2. Steering、Stop 和替换
改一个已委派任务的方向就是 Steering,和对普通 Session 说"不对,改成重构"一样。如果目标 Turn 已经结束,这条 steer 会变成下一轮,普通 Session 本来就是这样处理的。把工作换到另一个 Session,就是按精确的 Turn id 停掉,再委派;按精确 id 停止,就不会误伤无关的工作。这两步各自都是普通的 Host 操作,有自己的恢复,中间没有需要恢复的状态。替换事务能防住的哪种故障,是这两步防不住的?
3. 模型与执行策略
bypass本来就是产品默认值,沙箱也本来就要重做。另外还有一个结构上的理由:复用的 Session 如果还是ask,就会卡在 WorkHub 不转发的审批上,这和问题转发是同一个 worker 挂起问题,只是换了个名字。唯一要明说的一点:用户明确把某个 Session 设成ask的,通过 WorkHub 委派后会被切到bypass。这是有意为之,应该明说,不要藏起来。如果这三点成立,我会把由此得出的模型更新到提案里,然后开始重构。
AI assistance: drafted with Devin from the maintainer's positions.
ARE404 commentedon Sep 29, 2026
I agree with the other points in the proposal. Model configuration is the area where I think we should discuss the trade-offs further. Having separate models for coordination or routing, new tasks, and existing Sessions could create too much cognitive overhead for users.
I see two possible directions:
The goal in either case is to reduce the number of model settings users need to understand. I’d like to hear which direction seems to fit the simpler configuration model best.
Astro-Han commentedon Sep 30, 2026
Thanks, @ARE404. Agreed that the number of model scopes is the real problem, and I'd keep the answer as simple as possible, which is essentially your second direction:
I'd skip the option for existing Sessions to switch to the WorkHub model. That would add another scope, which is the thing we're trying to remove. The trade-off is that you can't coordinate with a cheaper model and do the work with a stronger one, but that follows from dropping the separate routing model anyway.
If this works for you, I'll fold it into the proposal together with the other points. Since you offered to help, would you like to take the refactor itself? You've thought through these boundaries more than anyone, so I think it would be in good hands, and I'm happy to review early drafts.
中文
谢谢 @ARE404。同意模型范围太多才是真正的问题,我倾向于用最简单的答案,基本就是你的第二个方向:
我不打算加"已有 Session 改用 WorkHub 模型"的选项,那会再多一种范围,正是我们要去掉的东西。代价是没法用便宜模型协调、强模型干活,但这本来就是去掉单独路由模型的自然结果。
如果你觉得可以,我会把这一点和其他几点一起更新到提案里。你之前说愿意帮忙,要不要由你来认领这次重构?这些边界你想得最细,交给你我很放心,也很乐意尽早帮你看草稿。
sunrioa commentedon Sep 30, 2026
Thanks for the proposal and the discussion. I ran into a case yesterday that seems relevant to the discovery and reuse part of this refactor, so I'm sharing it as a data point. If it would be better tracked on its own, I can open a separate issue.
I asked WorkHub to list the contents of a folder on my Desktop. The coordinator's reasoning noted that the request was new and that the 18 candidates were unrelated, but since
create_newrequires an explicit request, it offered a single existing Session throughselect_and_delegate, matched on its auto-generated title ("查看文件夹下所有项目", roughly "view everything in a folder"). That Session was one I had used 9 days earlier to read a different project's code, in a different workspace. The selection form had only that option and cancel, so I confirmed it without realizing how old it was.The delegated Turn made 6 model calls (a DeepSeek model) and carried about 90k tokens of unrelated history on each: 550,889 input tokens in total, 182,505 of them cache misses. The first call missed because the cache had long expired. Another full miss came right after
tool_searchactivated tools mid-turn, which I think is a separate runtime issue. For comparison, the first call in that Session when it was new was 4,237 tokens. Because the workspace differed, the Turn also had to request a sandbox boundary expansion first.I understand requiring an explicit
create_newis intentional (the gate enforces it per the ADR) to avoid Session sprawl. Two small changes might help alongside the planned discovery work: showing each candidate's context size and last activity, and adding a "new task" option to the selection form.中文
感谢这份提案和讨论。我昨天遇到了一个案例,看起来和这次重构中发现与复用的部分有关,所以作为一个数据点分享出来。如果更适合单独跟踪,我可以另开一个 issue。
我让 WorkHub 列出我桌面上一个文件夹的内容。协调者在推理中已经判断出这是一个新请求,18 个候选都与之无关;但由于
create_new需要用户明确要求,它通过select_and_delegate只提供了一个已有的 Session,依据是自动生成的标题“查看文件夹下所有项目”。那个 Session 是我 9 天前用来阅读另一个项目代码的,工作区也不同。选择框里只有这一个选项和取消,所以我在没意识到它有多旧的情况下确认了。这次委派的 Turn 调用了 6 次模型(DeepSeek 模型),每次都带着约 9 万 token 的无关历史:总输入 550,889 token,其中 182,505 未命中缓存。第一次调用未命中,是因为缓存早已过期。紧接着
tool_search在 Turn 中途激活工具之后,又出现了一次整段未命中,我认为这是一个单独的运行时问题。作为对比,这个 Session 刚创建时的第一次调用只有 4,237 token。由于工作区不同,这个 Turn 还需要先申请沙箱越界。我理解要求明确的
create_new是有意为之(按 ADR 的规定由 gate 强制执行),目的是避免 Session 越开越多。在计划中的发现改进之外,有两个小改动可能有帮助:为每个候选显示上下文大小和最后活动时间;以及在选择框里加一个“新建任务”选项。AI assistance: drafted with Claude Code from my own WorkHub transcript and usage data.
chihumyum commentedon Sep 30, 2026
@Astro-Han @ARE404 I'd like to contribute a focused slice of this refactor: read-only inspection of existing Sessions.
The initial scope would expose bounded recent user/assistant messages and execution status, reusing the existing transcript reader and current candidate scope. Reads would not send messages or start Turns.
The acceptance cases would be accurately quoting a Session’s latest assistant reply and reporting recent task progress with source references and explicit truncation.
Would this fit the planned discovery interface? If so, I can open a focused implementation issue and take it.
ARE404 commentedon Sep 30, 2026
@chihumyum
Thanks for offering to take this on. The read-only Session inspection work sounds useful, but I think it can be scoped independently from the main WorkHub refactor: it adds a discovery capability without being a prerequisite for simplifying the coordination and configuration model.
I’ll take the lead on the main WorkHub refactor. Could you open a separate focused issue for the read-only inspection slice, including the proposed scope and acceptance cases, and take it from there? We can then track how it connects to the refactor without coupling the two efforts.
chihumyum commentedon Sep 30, 2026
@ARE404 Thanks for taking the lead on the main refactor. Agreed — I’ve opened #5874 for read-only Session inspection, with the scope and acceptance cases we discussed, and will take it forward independently. We can use that issue to keep the integration aligned.
M4n5ter commentedon Sep 30, 2026
English
My main concern here is whether the simplified design has clear concepts and boundaries. We can accept a substantial refactor; minimizing the size of the change does not need to be the goal.
I suggest discussing three questions separately:
1. Creating a new Session vs. reusing an existing one
In sunrioa's example, the coordinator had already judged the candidates irrelevant, but the
explicit create_newrequirement still blocked the new-Session path. If intent interpretation belongs to the coordinating Agent, should it also be allowed to create a Session for an independent request, reuse one when the request clearly continues existing work, and ask when the intent is ambiguous? The selection UI should also let the user explicitly choose “New task.”2. Session identity vs. context window
Continuing the same Session does not necessarily require carrying its entire previous context forward. Codex has an experimental implementation that replaces the context window and uses notes and history retrieval to continue the task. This is worth exploring as a separate Session-level capability. It does not all need to be implemented in this refactor, but the coordination layer should avoid coupling Session reuse to reuse of the existing context window.
3. Permissions and execution boundaries
The latest comment says that reusing a Session preserves its configuration. Does this also include its existing approval policy? This needs to be reconciled explicitly with the earlier
ask→bypassproposal.Also, if the old execution has been stopped but the new delegation fails, or the process restarts in between, how is the unfinished request preserved and recovered? These guarantees should belong to the common execution layer; they do not necessarily require a WorkHub-specific protocol.
I think agreeing on these boundaries first would make it easier to decide which mechanisms can be removed, and distinguish redundant implementation from semantics we still need to preserve.
中文
这里我更关心的是,简化后的概念和边界是否足够清楚。我们可以接受较大的重构,不必以改动最少为目标。
建议把三个问题分开讨论:
1. 新建还是复用
sunrioa 的例子里,协调者已经判断候选不相关,但新建路径仍被
explicit create_new的要求挡住了。如果意图理解交给协调 Agent,是否也应该允许它为独立请求新建 Session,明确延续已有任务时才复用,有歧义时再询问?选择界面也应该允许用户直接选“新建任务”。2. 会话身份和上下文窗口
继续同一个 Session,不一定要继续携带整段旧上下文。Codex 的实验实现会替换上下文窗口,通过笔记和历史回查延续任务,这个方向值得参考。它可以作为 Session 底层能力独立演进,不必全部放进这次重构,但协调层最好不要把复用 Session 和复用旧窗口绑定起来。
3. 权限和执行边界
最新提到“复用不改配置”,这里是否也包括保留原来的审批权限?这需要和前面
ask→bypass的提议明确对齐。另外,停止旧执行后,如果新委派失败或进程重启,未完成的请求如何保留和恢复?这些保证应该由通用执行层负责,不一定需要 WorkHub 专用协议。
我觉得可以先对齐这三个边界,再决定哪些机制可以删除。这样更容易判断删掉的是重复实现,还是仍然需要的语义。
sunrioa commentedon Sep 30, 2026
Thanks for picking up the example. I'd like to expand on question 1, because the case made me think the direction could go a step further than allowing creation.
The proposal says WorkHub's purpose is to reduce the Session-management burden on users. Today, though, whether to start a new Session is still left to the user: the coordinator may only create one when the user explicitly asks, and otherwise it has to pick an existing Session. In my case that meant I was asked to confirm a routing choice without the information needed to judge it, such as the Session's age, context size and workspace. If intent interpretation belongs to the coordinating agent, could Session management belong to it as well? The agent would decide when to create, reuse, organize and retire Sessions, and the user would only step in when the intent is ambiguous or they want to override the choice.
Concretely, this could look like:
whs_), and the sidebar already groups Sessions by project, so this may not need a new concept.Why I think this is worth considering:
The costs I can see:
create_new(ADR) to avoid Session sprawl, so this would need an ADR amendment. I don't think the sprawl concern goes away; it moves from what the user sees to how the agent organizes Sessions.I don't know whether this is too large for the current refactor. If it's worth exploring, I can write it up as a separate Discussion.
Separately, on question 2: #5879 describes a related cost, where
tool_searchactivation invalidates the cache of a long Session.中文
感谢引用这个例子。我想就第 1 个问题展开说一下,因为这个案例让我觉得,方向可以比“允许新建”再往前走一步。
提案里说,WorkHub 的目的是减轻用户管理 Session 的负担。但现在,要不要新开 Session 仍然由用户决定:只有用户明确要求时,协调者才能新建;否则它只能从已有的 Session 里挑一个。在我的案例里,这意味着我被要求确认一个路由选择,却没有做判断所需的信息,比如这个 Session 有多旧、上下文多大、在哪个工作区。既然意图理解交给协调 Agent,Session 的管理是否也可以交给它?由 Agent 决定何时新建、复用、整理和移出 Session,用户只在意图有歧义、或想推翻它的选择时介入。
具体来说,可以是这样:
whs_),侧边栏也已经支持按项目分组,所以可能不需要引入新概念。我认为值得考虑的原因:
我能想到的代价:
create_new,目的是避免 Session 越开越多,所以这需要修订 ADR。我不认为这个顾虑会消失,它只是从用户能看到的地方,转移到了 Agent 如何整理 Session 上。我不确定这对当前的重构来说是否太大。如果值得探索,我可以单独写一个 Discussion。
另外,关于第 2 个问题:#5879 描述了一个相关的成本问题,
tool_search激活工具会让长 Session 的缓存失效。AI assistance: drafted with Claude Code from my own WorkHub usage data and the current code.
feat(workhub): inspect existing session conversations (#5886)
ARE404 commentedon Oct 1, 2026
Thanks, @M4n5ter and @sunrioa, for raising these questions. Here is where I currently land on the boundaries:
Creating and reusing Sessions. The coordinating Agent should be able to create a Session for an independent request without requiring the user to explicitly say “create a new task.” That was also my intent in the original design. It should reuse a Session when the request clearly continues existing work, and ask when the intent is ambiguous. Session organization, grouping, and removal from candidates are worth exploring, but I’d like to complete the refactor of the basic coordination functionality first.
Session identity and context window. I agree that these concepts should be separate. The coordination interface only needs to express “continue this Session”; preparing and managing the execution context remains the target Session’s responsibility. I don’t think this refactor needs to introduce context management in WorkHub.
Execution permissions. Executions initiated through WorkHub should use WorkHub’s permission settings, including when reusing an existing Session. I’d apply those settings to the delegated execution without permanently changing the target Session’s existing configuration.
Stopping and delegating again. I’m comfortable with simple semantics: stopping the old execution and initiating the new delegation are separate operations, and partial success is possible. If stopping succeeds but delegation fails, the coordinating Agent should accurately report the current state and decide whether to retry, select another target, or ask the user. After a process restart, persisted conversation and operation results should also let it determine which steps have completed. We need to verify that the common Session/Host recovery mechanisms support this behavior, but I don’t think we need to retain a WorkHub-specific replacement transaction solely to make these two operations atomic.
Also, @Astro-Han, I’d like to discuss communication after the refactor to a coordinating Agent. My current inclination is to reuse ordinary cross-Session messaging for delegation, Steering, and returning results or missing information, with message delivery and recovery handled by the common Session/Host layer.
Do you think we need a separate message-sending or mailbox mechanism here? I’d like to first clarify how messages are received while the target is executing, and how returned results allow the coordinating Agent to continue. Are there concrete scenarios that ordinary messaging cannot cover and that require an additional mechanism?
sunrioa commentedon Oct 26, 2026
Following up on the earlier discussion about Session creation, reuse and context windows, I would like to share a task-centric model I have tried in Baka, my experimental Maka fork.
Below is a self-contained introduction to its architecture and behavior for reference. The implementation continues to use Maka’s Runtime Host, ordinary Sessions, tools, permissions and persistence.
1. The basic model: stable tasks with replaceable execution contexts
In this model, the user advances work through one WorkHub conversation. The coordinating Agent can answer directly, create independent work, continue an existing task, or ask for clarification.
A task represents an objective that can receive follow-ups and corrections. Its identity remains stable across Turns and, when appropriate, across Sessions.
For example:
Task A remains identifiable after moving from S1 to S2. Creating independent work and replacing an existing task’s execution context are separate operations.
The Agent still has to judge whether a request continues an earlier objective. Titles, directories and recent activity provide evidence; they do not establish identity by themselves. Persisting task identity prevents a context replacement from automatically fragmenting the work, but does not guarantee that the model will always interpret a follow-up correctly.
Projects and working directories remain execution properties with real permission boundaries.
2. Overall architecture
flowchart TB U["User"] --> MAIN["WorkHub main conversation"] MAIN --> C["Coordinating Agent<br/>ordinary persistent Session"] C --> API["Task actions and bounded reads"] PANEL["Task panel<br/>history and explicitly targeted input"] --> H API --> H["Existing Runtime Host<br/>provenance, ownership, permissions<br/>admission and idempotency"] H --> Q["Existing queue and resource rules<br/>FIFO, concurrency and directory constraints"] Q --> A["Task A<br/>current Session segment"] Q --> B["Task B<br/>current Session segment"] A --> E["Persisted execution events<br/>task-to-segment relationships<br/>original results and tool output"] B --> E E --> N["Bounded result notification<br/>task identity, status and result reference"] N --> C E --> I["Rebuildable task search index"] H -. "Discovery queries" .-> I H -. "Authorized source reads" .-> E A -. "Same-task historical read request" .-> HThese are logical responsibilities, not additional services or processes.
The Host validates the concrete operation. It does not contain another natural-language resolver or claim to prove that the Agent selected the semantically correct task.
3. Coordination interface
The experiment uses five task actions and one reader:
findstartcontinueaskstopWorkHubReadThere is one coordinating model making the semantic decision. Discovery supplies evidence; it does not run a pre-routing model or bind the operation to an entire candidate snapshot.
The two input surfaces have explicit meanings:
Previewing task A therefore does not silently redirect a main-conversation follow-up from topic B to A. Automatic result notifications also do not become new user instructions or automatically replace the current topic.
4. A shared input contract
Coordinator-issued continuations and direct task-panel input reach the same Host-owned implementation.
The implementation does not register a delayed fresh operation while the task is busy. Unsupported active-backend input is rejected explicitly.
Receipts distinguish acceptance, queueing, consumption and completion. Accepting a correction does not prove that the Agent has read or followed it.
Stopping old work and delegating again remain separate operations. Partial success is reported through persisted operation results; there is no WorkHub-specific atomic replacement transaction.
5. Fresh context and historical reading
The Agent chooses reuse or fresh based on the work and available context information. There is no fixed token threshold forcing a new Session.
For fresh, the new native segment receives:
It does not receive a full transcript copy or require an additional LLM handoff-summary call. Temporary one-Turn approvals do not propagate.
sequenceDiagram participant U as User participant C as Coordinator participant H as Runtime Host participant W as New native Session participant E as Original events and outputs U->>C: Continue earlier work C->>H: Find/read task context as needed H-->>C: Bounded evidence and task references C->>H: Continue task A with fresh context H->>H: Validate ownership, capability, settings and settlement alt Busy or unresolved interaction H-->>C: Reject with the actual reason else Eligible settled native task H->>E: Persist task A to new-segment relationship H->>W: Instructions, bounded context, settings and read entry H-->>C: Admission receipt loop Historical evidence needed W->>H: Read task A source with optional cursor H->>H: Verify caller, task lineage and visibility H->>E: Read original event or archived output E-->>H: Source content H-->>W: Bounded page and next cursor end W->>H: Execution events and result H->>E: Persist actual outcome H-->>C: Bounded result notification C-->>U: Result and remaining limitations endHistorical reads have actor-specific scopes:
Hidden reasoning and unrelated task history remain excluded.
Archived tool output is read through a source-bound Host path with pagination. A new Session cannot simply assume that an old Session-local output address is within its own read scope. Missing, deleted or unsupported sources return explicit limitations.
Executor fresh is currently rejected because those providers lack the required Host-native historical-read bridge.
6. Coordinator context and configuration
The coordinator is itself a long-lived Session. The implementation keeps its context manageable through:
/compactentry and configurable compaction settings.Automatic notifications and preview selection do not reorder the recent conversational topic. The reference block is a discovery aid, not a complete memory database or route binding.
Compaction remains a Runtime capability. It has summarization cost and may rebuild prompt caches. Its configuration is separate from the Agent’s task-level reuse/fresh decision.
In this branch, new tasks use the applicable defaults, while existing tasks retain their current persistent settings. Fresh inherits those settings, including explicit later changes. Existing task permissions and native question/approval interactions remain in effect.
This differs from the earlier automatic
ask→bypassproposal. It describes the branch’s behavior without resolving the separate model/default and execution-policy choices discussed here. Effective permissions continue to come from authorized Host decisions.7. Recorded validation
The branch has recorded macOS tests using Command Code DeepSeek across several implementation revisions:
These are specific functional observations, not a general routing-accuracy or cost benchmark. They do not establish universal absence of
not_found, lower monetary cost, or support across every model and platform. Long-context pressure tests used explicitly identified fixtures.The additional persistent state is primarily the relationship between tasks, accepted inputs and execution segments, together with source authorization. That relationship has a maintenance and compatibility cost; it is part of the experiment rather than something the model can infer reliably from titles alone.
8. Source baseline and trying the branch
The upstream baseline for this version is Maka main commit
dcef64275, dated 2026-10-04.The Baka implementation described here is
04281faee, dated 2026-10-23. The two dates distinguish the upstream baseline from subsequent work in the fork.The described version can be built and tried from source. With the platform dependencies required by that version of Maka, Node.js 24 and npm 11.19.0:
git clone https://github.com/sunrioa/baka.git cd baka git checkout 04281faee875d381d7f5d6a13e7408888ae9ba27 npm ci npm run build npm run dev:worktreeConfigure a model connection, enable WorkHub in General settings, and open WorkHub. The worktree launcher selects a separate development data directory for the checkout. Application and launcher names still follow Maka.
I am sharing this branch’s architecture and recorded behavior as a concrete reference for the ongoing WorkHub discussion.
中文对照,含中文架构图
接着此前关于 Session 新建、复用和上下文窗口的讨论,我想补充一个在自己的 Maka 实验分支 Baka 中尝试过的任务中心模型。
下方介绍它的架构和实际行为,供讨论参考。实现继续使用 Maka 的 Runtime Host、普通 Session、工具、权限和持久化机制。
1. 基本模型:任务身份稳定,执行上下文可以更换
用户通过一个 WorkHub 主对话推进工作。协调 Agent 可以直接回答、创建独立工作、继续已有任务,或者询问以澄清意图。
任务表示一个可以持续接收追问和纠正的目标,其身份跨 Turn 保留,必要时也跨 Session 保留。
从 S1 换到 S2 后,任务 A 的身份不变。创建独立任务和更换原任务的执行上下文是两个操作。
Agent 仍然需要判断自然语言是否在延续原目标。标题、目录和近期活动只是判断材料,不能证明任务归属。持久任务身份能够避免仅因换上下文而切碎任务,但不能保证模型永远关联正确。
项目和工作目录仍然是实际执行属性,权限边界也继续存在。
2. 整体架构
flowchart TB U["用户"] --> MAIN["WorkHub 主对话"] MAIN --> C["协调 Agent<br/>普通的持久 Session"] C --> API["任务动作与有界读取"] PANEL["任务面板<br/>历史展示与明确目标输入"] --> H API --> H["既有 Runtime Host<br/>真实来源、执行归属、权限<br/>准入与幂等"] H --> Q["既有排队与资源规则<br/>FIFO、并发和目录资源约束"] Q --> A["任务 A<br/>当前执行 Session 段"] Q --> B["任务 B<br/>当前执行 Session 段"] A --> E["持久执行事件<br/>任务与执行段关系<br/>原始结果和工具输出"] B --> E E --> N["有界结果通知<br/>任务身份、状态与结果引用"] N --> C E --> I["可重建的任务搜索索引"] H -. "发现与搜索" .-> I H -. "授权范围内回源" .-> E A -. "读取同任务历史的请求" .-> H图中表示逻辑职责,不是新增一批服务或进程。
Host 校验具体操作,不内置另一套自然语言解析器,也不声称能证明 Agent 选对了任务。
3. 协调接口
实验使用五个任务动作和一个读取工具:
findstartcontinueaskstopWorkHubRead语义判断由一个协调模型完成。发现工具提供材料,不运行额外预路由模型,也不把操作绑定到整个候选列表快照。
两个输入位置的含义明确区分:
因此,仅预览 A,不会将总对话中原本围绕 B 的追问偷偷改派到 A。自动结果通知也不会成为新的用户指令或自动替换当前主题。
4. 共用输入契约
协调者续办和任务面板输入走同一条 Host 路径。
任务忙碌时不登记延迟 fresh。不支持的活动后端输入明确拒绝。
回执区分受理、排队、消费和完成。纠正受理成功,不代表 Agent 已经读到或执行。
停止旧工作与重新委派仍是两个操作。部分成功时通过持久结果如实报告,没有新的 WorkHub 原子替换事务。
5. fresh 与历史读取
Agent 根据工作和可用上下文信息决定 reuse 或 fresh,不按固定 token 数强制换 Session。
新原生执行段接收:
不复制全部旧转录,也不增加一次模型交接摘要。临时单轮审批不会随之扩散。
sequenceDiagram participant U as 用户 participant C as 协调 Agent participant H as Runtime Host participant W as 新原生 Session participant E as 原始事件与输出 U->>C: 继续此前的工作 C->>H: 按需查找任务及读取背景 H-->>C: 有界证据和任务引用 C->>H: 以 fresh 继续任务 A H->>H: 校验归属、能力、设置及执行结清 alt 任务忙碌或存在未决交互 H-->>C: 返回真实拒绝原因 else 已结束且支持换段的原生任务 H->>E: 持久保存任务 A 与新执行段的关系 H->>W: 要求、有界背景、设置与读取入口 H-->>C: 返回准入回执 loop 需要旧证据时 W->>H: 读取任务 A 的来源,可携带游标 H->>H: 校验调用者、任务执行关系及可见性 H->>E: 读取原事件或归档输出 E-->>H: 返回来源内容 H-->>W: 返回有界分页和后续游标 end W->>H: 执行事件与结果 H->>E: 保存真实执行结果 H-->>C: 投递有界结果通知 C-->>U: 反馈结果及剩余限制 end历史读取按实际调用者区分范围:
隐藏推理和无关任务历史不在范围内。
归档工具输出通过 Host 校验来源并分页回查。新 Session 不能假定旧 Session 的本地输出地址属于自己的读取范围。来源缺失、删除或不支持时,明确返回限制。
Executor 尚缺少相应的原生历史桥接,因此实验中明确拒绝 executor fresh。
6. 主协调上下文与配置
协调者也是长生命周期 Session,实现通过以下方式控制上下文:
/compact入口和可配置设置。自动通知和预览不改变近期对话主题顺序。近期引用是发现线索,不是完整记忆数据库或派发绑定。
压缩仍属于 Runtime,会产生摘要费用,也可能重建缓存。压缩配置与 Agent 对任务 reuse/fresh 的判断分开。
分支中新任务采用相应默认值;已有任务保留当前持久设置;fresh 继承这些设置及明确后续修改。原有权限和原生提问、审批继续生效。
这与前面自动
ask→bypass的提议不同。这里记录的是分支实际行为,不替本讨论决定模型默认值和执行策略。有效权限始终来自获得授权的 Host 决策。7. 已有验证记录
不同实现版本上,macOS 与 Command Code DeepSeek 的记录包括:
这些是具体功能观察,不是通用路由准确率或成本基准,也不证明永远没有
not_found、费用更低或所有模型与平台均支持。长上下文压力测试使用了明确标记的夹具。新增持久状态主要是任务、已受理输入与执行段之间的关系,以及相应来源授权。这些关系具有维护和兼容成本,也是实验模型的一部分。
8. 基线与编译体验
该版本的上游基线是 2026-10-04 的 Maka main 提交
dcef64275。本文介绍的 Baka 实现版本为 2026-10-23 的
04281faee。两个日期分别表示上游基线和分支后续实现版本。可以直接拉取源码编译体验。准备对应 Maka 版本需要的平台依赖,建议使用 Node.js 24 和 npm 11.19.0:
git clone https://github.com/sunrioa/baka.git cd baka git checkout 04281faee875d381d7f5d6a13e7408888ae9ba27 npm ci npm run build npm run dev:worktree启动后配置自己的模型连接,在通用设置中启用 WorkHub,再打开 WorkHub。Worktree 启动器默认为该 checkout 使用独立开发数据目录,应用和启动器名称仍沿用 Maka。
以上是我在 Baka 中尝试过的架构和已有行为记录,作为当前 WorkHub 讨论的一份具体实践参考。
AI assistance: Codex helped inspect the implementation and existing verification records, and draft this architecture summary. Posted by Codex at the author's request.