Repository navigation
Software Factory, and teams that work without config: a chat asks instead of a flag - #624
Conversation
A team could already plan a goal into tasks, build them and review each one -- but it was started in one window, watched in a second and talked to in a third, and the desktop's Ask built apps with a single agent unless the model happened to pick a team. - Start -> Software Factory, and "Build with a team" in Ask PasClaw: a sentence and a team template (Software Team by default, Duo for small things) start a team and open its factory window. New Team... and the model's team_up open it too. - The factory window: the conversation with the team's lead beside its live board. One timeline -- what the operator told the lead, what the lead replied at the end of each turn, and the board's events, each with its time; the board with Accept/Reject, Edit and + Task; a header with the team's state, who is busy and what waits in each mailbox, and the questions the team asked. Repaints on events, comes back after a reload. - Follow-ups go to the team. The factory's composer writes to the lead; after "Build with a team" Ask switches to "Tell the ... team", and every team at work has that entry. The operator writing to a team its finished board parked puts it back on; one the operator parked stays. - GET /v1/teams/<name>/feed serves the window. The lead's side is a new record: each finished turn's reply is kept with its time (replies.jsonl), because a session has the transcript but no times. /v1/teams/status and /v1/teams/up name each team's leads. Driven end to end in Chromium against a live gateway with the model played through the relay: Ask started a Duo team, the factory showed the kickoff, the lead's plan and the board's events, and follow-ups from the factory and from Ask both reached the lead. Server pieces revert-checked (ten caught; the eleventh is a prefilter whose rule ResumeParkedTeams holds and is already checked). Full make test passes; the replay bench is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
…agent tools A team is its board tools (project/task/rule) and the agent tool, and both sat behind flags that are off by default -- so a team started from the desktop on a fresh install woke its lead with no task tool, and the best the gateway could do was warn. Starting a team is already the operator's opt-in to agents that manage a board and message each other. The flags now decide one thing: whether an ORDINARY chat's model has the tools too. Off (the default), they register AgentOnly -- a new tool flag: offered in ToProviderDefs only on a standing agent's turn (the calling agent on this thread, via AgentTurnProbe), and refused by RunTool otherwise, so a model cannot call one it was never shown. On, everyone has them, as before. Same at gateway, serve and the CLI. The team-up warnings about the flags (desktop route and CLI) are gone: there is nothing left to warn about. Checked live with neither flag in config: team up gave no warning, the Foreman's first request carried task/agent/project/rule, and an ordinary chat on the same gateway carried none. Unit-tested and revert-checked (three of three caught). Full make test passes; the replay bench is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
A flag nobody turns on is a capability nobody has. The board tools
(project/task/rule), the agent tool and the desktop tool's team_up were
off for every ordinary chat unless config said otherwise, and nobody
edits config.
Now an ordinary chat ASKS. Those tools are not in a chat's tool list --
no schema bytes until wanted -- but tool_search finds them, and calling
one puts the question to the operator through the permissions machinery
that already existed: Allow once / Allow for this session / Deny, in
Needs you on the desktop, the TUI footer or the CLI prompt, with a reason
saying what the chat wants ("This chat wants to manage the project board
(task create)"). With nobody to ask the call is refused, never quietly
allowed. A permissions "allow" rule says yes in advance; a "deny" still
refuses; a standing agent's own turn is never asked. team_up is asked
the same way, read from the coerced action list the tool itself uses, so
a near-miss shape cannot slip past. The old switches still mean "yes for
every chat" for configs that set them. These tools are kept off PasClaw's
MCP server, which has nobody to ask.
Needs you now describes a call with no resource by its arguments ("task:
create, title Add a search box, project shop") and wraps the reason.
Checked live with no flags in config: a desktop chat found task with
tool_search, the call waited in Needs you, Allow once ran it and the task
was on the board; with no desktop connected the same call was refused.
Unit-tested through the dispatcher and the MCP server; nine revert-checks
caught. Full make test passes; the replay bench is unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a1ec40e8b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { team_up is the operator's to allow, and was asked BEFORE this ran: | ||
| the tool loop's permission gate puts the question (DesktopConsent) | ||
| ahead of the publish, which is the point of no return -- the | ||
| connected desktop acts on it immediately. } |
There was a problem hiding this comment.
Enforce team consent for inbound MCP calls too
With a desktop connected and agent_tools_enabled off, an inbound HTTP MCP client can now call desktop with {"actions":[{"do":"team_up","brief":"build something"}]} and start autonomous agents without approval. TMCPServerCore.HandleToolsCall invokes FRegistry.RunTool directly, bypassing the tool loop's DesktopConsent check. The new MCP exclusion does not help because desktop has AskOutsideAgents = False and is categorized as read-only, so this also works on the default read-only MCP endpoint. Preserve an enforcement path for callers that do not pass through PermissionGate before publishing the command.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 5a4f7f8. The desktop tool is registered read-only, so the default MCP endpoint did expose it, and HandleToolsCall → RunTool never met DesktopConsent.
The fix: the tools now enforce consent themselves.
- The gate marks its pass. When the tool loop's permission gate passes, it sets a per-thread mark (
SetDispatchGatePassed) for exactly as long as the tool runs. It's saved and restored, so nested dispatch is safe. - The tools check the mark. The desktop tool refuses a
team_upthat didn't come through the gate, before it publishes.RunTooldoes the same for the board and agent tools when an ordinary caller reaches them some other way. - Unchanged: the old
agent_tools_enabledswitch still says yes in advance.
Also fixed while I was in there: OutsideAgentConsent exempted a standing agent's turn from every question, team_up included. A team member could start another team without asking. A team's own tools stay unasked for its members, but team_up is now asked on every turn.
Tests: projects_tests and team_board_tests cover a direct call (the MCP path) being refused in each shape, and a call that came through the gate with a yes running. I confirmed both fail if the fix is disabled.
Generated by Claude Code
| from ToProviderDefs. Aliases go through RegisterHidden instead. } | ||
| Modified.Hidden := False; | ||
| Modified.CodeMode := False; | ||
| Modified.AskOutsideAgents := False; |
There was a problem hiding this comment.
Preserve the consent flag when cloning subagent registries
When an ordinary chat uses spawn or spawn_background with the default general-purpose toolset (*), BuildFilteredRegistry copies the newly registered board and agent tools through CopyPreservingMode, which calls Register and clears their AskOutsideAgents flag here. Those tools consequently become ordinary, provider-visible tools in the child, and OutsideAgentConsent no longer asks or refuses their calls even though both configuration flags are off. Update the registry-copy path to preserve this registration mode so delegating work cannot silently grant powers that require consent in the parent chat.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 5a4f7f8. CopyPreservingMode preserved only CodeMode, so it re-registered the board and agent tools with plain Register and the child lost AskOutsideAgents.
The copy now calls RegisterAskOutsideAgents for those tools. A subagent spawned from a chat with * inherits the question, not the tool: it's absent from the child's provider list and asks like its parent would.
There's also a second guard independent of the copy: RunTool refuses those tools to an ordinary caller that didn't come through the permission gate.
Tested in team_board_tests (BuildFilteredRegistry(R, ['*']) keeps the mode, and the tool is not offered). The test fails with the fix disabled.
Generated by Claude Code
Codex on #624, two P1s, and a third found while fixing them: - PasClaw's MCP server runs tools directly (RunTool), never meeting the tool loop's permission gate -- and the desktop tool is exposed read-only, so an MCP client could start a team with no question asked. The gate now marks the call it passed (a per-thread mark, set for exactly as long as the tool runs, nesting-safe), and the tools hold the line themselves: the desktop tool refuses a team_up that did not come through the gate, and RunTool refuses a standing agent's tool (board, agent) to an ordinary caller that did not. - A subagent's registry is a copy, and CopyPreservingMode re-registered everything but code-mode tools plainly -- clearing AskOutsideAgents, so a chat could spawn its way past its own question. The copy now keeps the mode. - OutsideAgentConsent exempted a standing agent's turn from every question, team_up included: a team member could start another team unasked. A team's own tools stay unasked for its members; starting a team is asked on every turn. Tested: direct calls refused (registry and tool), a yes through the gate still runs, the subagent copy keeps the question, a team member's team_up asks; five revert-checks caught. Full make test passes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KYD1zZPD7GuM8pF1btwi2U
Three commits on top of #623. Together they make one sentence on the desktop become a team building it, with no config to edit.
0463c2f— the Software Factoryteam_upnow open the factory too.GET /v1/teams/<name>/feedserves the window.replies.jsonl, because a session holds the transcript but no times./v1/teams/statusand/v1/teams/upnow name each team's leads.47fee38+7a1ec40— no flags: team members always have their tools, a chat asksdesktop_tools_enabledandagent_tools_enabledwere off by default, and nobody turns them on. So a team started on a fresh install woke its lead with notasktool.agenttool. A team is those tools, and starting one is the opt-in.tool_searchfinds them.allowrule says yes in advance, adenystill refuses, and a standing agent's own turn is never asked.team_upfrom a chat is asked the same way. The check reads the same normalised action list the tool itself uses, so an unusual spelling ({"action":"team_up"},TEAM_UP) can't slip past. Tiling windows asks nothing.Testing
make testpasses under FPC 3.2.2, andmake bench-teamboardis unchanged (29 calls, handoffs under a second).task,agent,projectandrule; an ordinary chat on the same gateway carried none of them.taskwithtool_search, the call waited in Needs you, and Allow once ran it, putting the task on the board.desktop_routes_tests: the feed's records, merge order, limit and same-second ordering; status; resume-on-message.team_board_tests: the ask through the real dispatcher (ask, allow once, deny, nobody to ask, allow rule, a standing agent's turn,team_up, tiling).mcp_server_tests: not exposed.projects_tests: theteam_upquestion for every shape.Known and not changed
askrule.Generated by Claude Code