Skip to content

A conversation can be told only about its own work (agents.set_scope) - #2462

Merged
AbirAbbas merged 4 commits into
workstreams/mainfrom
workstreams/l-fix9-cross
Nov 6, 2026
Merged

AbirAbbas merged 4 commits into
workstreams/mainfrom
workstreams/l-fix9-cross

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Summary

A conversation can now be told only about its own work. Today every conversation in a folder gets an <elsewhere> block with the other conversations' landed and running work there (with the files each wrote), and its tasks tool lists the folder's whole task index. A client that keeps a long-lived conversation in a person's shared work folder needs that conversation to see only its own work while keeping its folder, transcript and history.

  • session.Meta.Scope: conversation, or absent for project (today's behaviour). Written by session.SetConversationScope under the existing cross-process meta lock; the session's own stamps patch only their fields, so it survives them.
  • Read beside the turn in refreshElsewhere and in the tasks tool (both already read disk), so a live conversation follows the stored word from its next turn with no remote-protocol change. Scoped: no <elsewhere> block; the tasks tool lists and addresses only this conversation's rows; no running-in-other-windows or everywhere sections. The person's @ list, task nodes and the write-safety warnings (ground shift, preflight) are unchanged.
  • Wire: agents.set_scope {id, scope} → {id, scope}; hello feature agents.scope. It never opens, warms or interrupts the conversation (like agents.mark_seen). bad_params, not_found, conflict (lent conversation or no local folder), unknown_method on engines without the door.

Why a stored switch rather than moving a conversation to another folder: Config.Workspace is captured at launch and the session folder, task index, presence, told stamp and transcript URIs are keyed on it; a move would re-key all of them. A live in-memory dial would need new remote-protocol plumbing because app conversations are remote.Agent connections. The stored word is one field, one setter and two read sites. (The Workstreams plan, L-FIX9.)

Validation contract

Item Behaviour Test
A1 scoped conversation gets no <elsewhere> block despite another conversation's recent landing and running task TestConversationScopeLeavesOtherWorkOutOfTurnContext
A2 its tasks tool lists/reads/steers/resolves only its own tasks; no other-window or everywhere sections TestConversationScopeTasksReachOnlyItsOwnRows, TestConversationScopeKeepsItsLiveGraphWhileFilteringTheMergedIndex, TestConversationScopeLeavesATaskNodesChildrenVisible
A3 unset or project behaves exactly as before TestProjectScopeKeepsOtherWorkVisible, TestConversationScopeDefaultsQuietlyToProject
A4 survives reload and later effort/title/spend/places stamps TestConversationScopeSurvivesReloadAndLaterMetadataStamps
A5 an earlier block clears at the next reading TestConversationScopeClearsAnEarlierBlockOnTheNextReading
A6 changes nothing else in meta.json or the transcript; repeat writes nothing TestConversationScopeChangesOnlyItsStoredWord, TestConversationScopeStaysInMetaBesideSealedConversationSettings
A7 wire validation, hello gating, unknown_method, not_found, lent refusal, closed agent written without opening internal/appwire/agent_scope_test.go, cmd/codeaf/appscope_test.go
A8 unknown word and folder without meta.json refused; never minted TestConversationScopeRefusesUnknownWordsAndMissingConversations

Left for later

The scope is local meta.json state: it is not carried when a conversation moves to another computer.

🤖 Generated with Claude Code

AbirAbbas and others added 4 commits November 6, 2026 09:30
…tion context

A conversation's meta.json can now store scope "conversation". Such a
conversation gets no <elsewhere> block on its turns, and its tasks tool lists
and addresses only its own tasks (no other conversations' landed rows, no
running-in-other-windows or everywhere sections). The default, project, keeps
today's behaviour. The word is written under the meta lock and read beside the
turn and in the tasks tool, so a live conversation follows it from its next turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pening it

agents.set_scope {id, scope} stores project or conversation in the
conversation's meta.json and answers the stored word. It never opens, warms or
interrupts the conversation. Engines that serve it announce agents.scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the scope

The new scope words are WorkScopeProject/WorkScopeConversation (ScopeProject
already names an answer scope). agents.set_scope returns *AgentScope as typed
handlers must. saveMetaLocked keeps the stored scope when a whole-Meta writer
loaded before a scope change saves with none, and project is stored as its own
word so a reset survives that rule too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas force-pushed the workstreams/l-fix9-cross branch from ea56746 to 2e3f564 Compare November 6, 2026 14:30
@AbirAbbas
AbirAbbas merged commit e985a44 into workstreams/main Nov 6, 2026
8 checks passed
@AbirAbbas
AbirAbbas deleted the workstreams/l-fix9-cross branch November 6, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant