CTO revamp: one persistent-memory agent thread (desktop + iOS) - #702
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Rebuilds the CTO tab around a single long-living agent thread with a smart, provider-agnostic memory system, and removes the legacy workers/hiring and Linear-workflow subsystems entirely.
Smart memory (files as truth, under
.ade/cto/)MEMORY.md— curated durable facts, always injected (injection capped; disk never truncated), editable in Settings, written by the CTO via newsaveMemory/searchMemory/readMemoryoperator tools.thread-state.md— rolling thread summary, flushed deterministically before compaction and before any model/provider switch (async LLM upgrade never blocks).HH:MM — intent → outcome), no LLM.Model switching never breaks the thread
modelPreferencesand the live session stay in sync both directions; foreign-lane CTO sessions rebind instead of silently orphaning the transcript; deadChatModelSwitchPolicyplumbing removed.Legacy removed completely (code, tests, docs)
ade cto/ade flow/ade linear workflows|sync|ingressCLI + TUI surfaces.ade linearissue bridge.UI
braintab icon (matches desktop), inline single-thread tab, one-card setup, trimmed settings with a Memory section via newcto.getMemorysync command.Validation
xcodebuildBUILD SUCCEEDED; /quality dual-review (0 Blocker/High) and /test consolidation both run.🤖 Generated with Claude Code
Summary by CodeRabbit
Greptile Summary
This PR rebuilds the CTO experience around one persistent agent thread with durable memory. The main changes are:
.ade/cto/memory files for durable facts, thread state, and daily turn logs.Confidence Score: 4/5
Mostly safe to merge after fixing the bound-runtime memory bridge bug.
The core memory service and chat lifecycle wiring are coherent, and the earlier memory eviction/search issues are addressed. Confidence is limited by one contained bug where desktop memory saves and searches send the wrong payload shape through runtime bindings.
apps/desktop/src/preload/preload.ts
What T-Rex did
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant User participant Desktop as Desktop CTO UI participant Preload as preload.cto bridge participant Runtime as Project runtime actions participant Memory as ctoMemoryService participant Chat as CTO agent thread participant iOS as iOS Sync client User->>Desktop: Edit/read CTO settings Desktop->>Preload: getMemory/updateMemory/searchMemory Preload->>Runtime: cto_memory action when bound Runtime->>Memory: getSnapshot/writeMemory/searchMemory Memory-->>Runtime: snapshot/search rows Runtime-->>Preload: result Preload-->>Desktop: memory state Chat->>Memory: writeThreadState before compaction/model switch Chat->>Memory: appendTurnJournal after completed turn iOS->>Runtime: cto.getMemory Runtime->>Memory: getSnapshot Memory-->>iOS: CtoMemory snapshot%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant User participant Desktop as Desktop CTO UI participant Preload as preload.cto bridge participant Runtime as Project runtime actions participant Memory as ctoMemoryService participant Chat as CTO agent thread participant iOS as iOS Sync client User->>Desktop: Edit/read CTO settings Desktop->>Preload: getMemory/updateMemory/searchMemory Preload->>Runtime: cto_memory action when bound Runtime->>Memory: getSnapshot/writeMemory/searchMemory Memory-->>Runtime: snapshot/search rows Runtime-->>Preload: result Preload-->>Desktop: memory state Chat->>Memory: writeThreadState before compaction/model switch Chat->>Memory: appendTurnJournal after completed turn iOS->>Runtime: cto.getMemory Runtime->>Memory: getSnapshot Memory-->>iOS: CtoMemory snapshotComments Outside Diff (1)
apps/desktop/src/main/services/chat/agentChatService.ts, line 7643-7670 (link)ctoMemoryService.buildMemoryContextSections()is not used when rebuildingpendingReconstructionContext, so facts saved throughsaveMemoryor Settings are persisted but not included after session start, compaction, or provider reset. The only CTO-specific context added here is identity, state reconstruction, continuity summary, and transcript tail; durableMEMORY.mdis omitted unless the model explicitly callsreadMemory.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (6): Last reviewed commit: "ship: search archive ahead of transient ..." | Re-trigger Greptile