Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(memory): add v2 memory service and playwright spec

Steven Enamakeldea8c30d4fb1
diff --git a/app/test/playwright/specs/memory-v2.spec.ts b/app/test/playwright/specs/memory-v2.spec.ts
index 1ec5237c0e..17be908fa8 100644
--- a/app/test/playwright/specs/memory-v2.spec.ts
+++ b/app/test/playwright/specs/memory-v2.spec.ts
@@ -11,17 +11,19 @@ import {
/**
* Memory v2 page (`/connections?tab=brain`, docs/specs/memory-v2.md).
*
- * Drives the real page in a browser through its chips — Engine, Ask (with the
- * memory pack preview), Learnings, Brain, Background — plus the "import
- * previous memory" consent flow and the memory-off state.
+ * Drives the real page in a browser through its three chips — Provider
+ * (engine), Conversations and Files (`brain`) — plus the "import previous
+ * memory" consent flow (at the top of Files) and the memory-off state. The
+ * retired chips (ask, explorer, learnings, background, settings, migration)
+ * must redirect to a kept chip.
*
* WHY THE MEMORY RPC IS MOCKED: the page only talks to the core through the
* `openhuman.memory_*` v2 methods (services/api/memoryApi.ts), and the engines
* behind them are hosted (TinyHumans) or self-hosted (CortexDB) services this
* lane must not reach. The v2 controllers may also not be in the core build the
* lane runs against yet. So every v2 memory method is answered in-browser by a
- * small stateful fake (sources grow on add, learnings grow on learn, an import
- * goes idle -> running -> done), installed with `page.route` BEFORE the page
+ * small stateful fake (sources grow on add, an import goes idle -> running ->
+ * done), installed with `page.route` BEFORE the page
* is opened. Every other method — auth, config, the app shell — passes through
* to the real core with `route.continue()`, exactly as
* `token-usage-load-failure.spec.ts` does, so only the memory surface is faked.
@@ -52,9 +54,6 @@ const ENGINES = [
},
];
-const PACK_MARKDOWN =
- '## What I know about you\n\n- Prefers concise answers\n- Working on project Atlas';
-
interface FakeOptions {
/** `memory_engine_get` reports TinyHumans as active (`ok`) when true, off when false. */
engineOn: boolean;
@@ -109,15 +108,6 @@ async function installMemoryFake(page: Page, opts: FakeOptions): Promise<MemoryF
? { engine: 'tinyhumans', has_key: false, status: 'ok', fetch_modes: ['keyword', 'vector'] }
: { engine: null, has_key: false, status: 'off', fetch_modes: [] };
- const learnings: Array<Record<string, unknown>> = [
- {
- id: 'learning-seed',
- kind: 'learning',
- text: 'The user prefers dark mode.',
- meta: { source: { kind: 'agent' } },
- score: 1,
- },
- ];
const sources: Array<Record<string, unknown>> = [];
let nextId = 1;
let migrating = false;
@@ -158,18 +148,6 @@ async function installMemoryFake(page: Page, opts: FakeOptions): Promise<MemoryF
agent_id: 'main',
host_bound: false,
};
- const brain = [{ source: 'markdown', documents: 3 }];
- const pendingJobs = [
- {
- id: 'job-1',
- root: 'user:e2e',
- job: { job: 'build_beliefs' },
- queued_at: '2026-10-01T09:00:00Z',
- attempts: 0,
- },
- ];
- const jobHistory: Array<Record<string, unknown>> = [];
-
/** The fake's answer per v2 method; `undefined` = not a v2 method, pass through. */
const handle = (method: string, params: Record<string, unknown>): unknown => {
switch (method) {
@@ -187,43 +165,10 @@ async function installMemoryFake(page: Page, opts: FakeOptions): Promise<MemoryF
status: 'ok',
fetch_modes: ['keyword', 'vector'],
};
- case 'memory_recall':
- return {
- answer: 'You decided to migrate project Atlas on Friday.',
- citations: [
- {
- id: 'cite-atlas',
- kind: 'document',
- snippet: 'Atlas migration lands Friday evening.',
- meta: { file_path: '/notes/atlas.md', source: { kind: 'folder' } },
- score: 0.92,
- },
- ],
- model: 'fake-recall',
- };
case 'memory_fetch':
return { hits: [], next_cursor: null };
- case 'memory_learn': {
- const id = `learning-${nextId++}`;
- learnings.unshift({
- id,
- kind: 'learning',
- text: params.text,
- meta: { source: { kind: 'agent' } },
- score: 1,
- });
- return { id };
- }
- case 'memory_forget': {
- const ids = new Set((params.ids as string[] | undefined) ?? []);
- const before = learnings.length;
- for (let i = learnings.length - 1; i >= 0; i -= 1) {
- if (ids.has(learnings[i].id as string)) learnings.splice(i, 1);
- }
- return { forgotten: before - learnings.length };
- }
case 'memory_items_list':
- return { items: [...learnings], next_cursor: null };
+ return { items: [], next_cursor: null };
case 'memory_policy_get':
return policy;
case 'memory_policy_set':
@@ -233,53 +178,12 @@ async function installMemoryFake(page: Page, opts: FakeOptions): Promise<MemoryF
return policy;
case 'memory_agents_list':
return { root: policy.root, agents: [{ agent_id: 'main', turns: 4 }] };
- case 'memory_pack_preview':
- return {
- agent_id: (params.agent_id as string | undefined) ?? policy.agent_id,
- root: policy.root,
- mode: params.query ? 'turn' : 'session',
- pack: {
- markdown: PACK_MARKDOWN,
- tokens: 42,
- refs: ['learning-seed'],
- sections: [{ heading: 'Learnings', hits: [learnings[0]] }],
- skipped: [{ heading: 'Team', reason: 'no team memory' }],
- engine: 'tinyhumans',
- },
- };
- case 'memory_brain_sources':
- return { root: policy.root, sources: [...brain], unfiled: 0 };
- case 'memory_brain_search':
- return { hits: [] };
case 'memory_brain_ingest':
return {
id: `doc-${nextId++}`,
source: (params.source as string) ?? 'markdown',
replayed: false,
};
- case 'memory_brain_forget': {
- const index = brain.findIndex(b => b.source === params.source);
- const forgotten = index >= 0 ? brain[index].documents : 0;
- if (index >= 0) brain.splice(index, 1);
- return { forgotten };
- }
- case 'memory_jobs_list':
- return { pending: [...pendingJobs], history: [...jobHistory] };
- case 'memory_jobs_run': {
- const runs = pendingJobs
- .splice(0)
- .map(job => ({
- id: job.id,
- job: job.job.job,
- root: job.root,
- ran_at: '2026-10-01T09:05:00Z',
- outcome: 'done',
- built: 2,
- stored: 2,
- }));
- jobHistory.unshift(...runs);
- return { runs };
- }
case 'memory_sources_list':
return { sources: [...sources] };
case 'memory_sources_add': {
@@ -428,7 +332,7 @@ async function openMemory(page: Page, query = '') {
const hash = (page: Page) => page.evaluate(() => window.location.hash);
test.describe('Memory v2 — engine active', () => {
- test('lands on Provider and drives engine, ask, pack preview, learnings, brain and background', async ({
+ test('lands on Provider and drives the three tabs: engine, conversations and files', async ({
page,
}) => {
const fake = await installMemoryFake(page, { engineOn: true });
@@ -447,70 +351,55 @@ test.describe('Memory v2 — engine active', () => {
await expect(page.getByTestId('memory-engine-status')).toHaveText('In use');
await expect(page.getByTestId('memory-engine-chip-active-builtin')).toBeVisible();
- // 2. Ask: the recall answer and its citation render.
- await page.getByTestId('brain-tab-ask').click();
- await page.getByTestId('memory-ask-input').fill('When does Atlas migrate?');
- await page.getByTestId('memory-ask-submit').click();
- const answer = page.getByTestId('memory-ask-answer');
- await expect(answer).toContainText('migrate project Atlas on Friday');
- await expect(page.getByTestId('memory-citation-cite-atlas')).toContainText(
- 'Atlas migration lands Friday evening.'
- );
- expect(fake.paramsOf('memory_recall')).toEqual([{ question: 'When does Atlas migrate?' }]);
-
- // 2b. Pack preview: what a new session would start with.
- await page.getByTestId('memory-ask-mode-pack').click();
- await page.getByTestId('memory-pack-submit').click();
- const markdown = page.getByTestId('memory-pack-markdown');
- await expect(markdown).toContainText('What I know about you');
- await expect(markdown).toContainText('Prefers concise answers');
- await expect(page.getByTestId('memory-pack-tokens')).toContainText('42 of 1500');
- await expect(page.getByTestId('memory-pack-skipped-Team')).toContainText('no team memory');
- expect(fake.paramsOf('memory_pack_preview')).toEqual([{}]);
-
- // 3. Learnings: a new learning is stored and listed.
- await page.getByTestId('brain-tab-learnings').click();
- await expect(page.getByTestId('memory-learning-learning-seed')).toBeVisible();
- await page.getByTestId('memory-learning-input').fill('Standups are at 9:30.');
- await page.getByTestId('memory-learning-add').click();
- const learned = page.getByTestId('memory-learning-learning-1');
- await expect(learned).toBeVisible();
- await expect(learned).toContainText('Standups are at 9:30.');
- // The default kind is `fact`; nothing else rides along.
- expect(fake.paramsOf('memory_learn')).toEqual([
- { text: 'Standups are at 9:30.', kind: 'fact' },
- ]);
+ // The strip is exactly Provider, Conversations and Files.
+ await expect(page.getByTestId('brain-tab-conversations')).toBeVisible();
+ await expect(page.getByTestId('brain-tab-brain')).toHaveText('Files');
+ for (const gone of ['migration', 'ask', 'explorer', 'learnings', 'background', 'settings']) {
+ await expect(page.getByTestId(`brain-tab-${gone}`)).toHaveCount(0);
+ }
+
+ // 2. Conversations: the chat-logging controls render.
+ await page.getByTestId('brain-tab-conversations').click();
+ await expect(page.getByTestId('memory-conversations-tab')).toBeVisible();
- // 4. Brain: per-source counts, then register a synced folder source
- // (folder is the default kind).
+ // 3. Files: upload button, then register a synced folder source (folder
+ // is the default kind; only folder and file are offered).
await page.getByTestId('brain-tab-brain').click();
- await expect(page.getByTestId('memory-brain-source-markdown')).toContainText('3 documents');
+ await expect(page.getByTestId('memory-brain-tab')).toBeVisible();
+ await expect(page.getByTestId('memory-brain-add')).toBeVisible();
+ // The per-source counts and brain search are gone.
+ await expect(page.getByTestId('memory-brain-sources')).toHaveCount(0);
+ await expect(page.getByTestId('memory-brain-search-input')).toHaveCount(0);
await expect(page.getByTestId('memory-sources-empty')).toBeVisible();
await page.getByTestId('memory-sources-add').click();
await expect(page.getByTestId('memory-add-source')).toBeVisible();
+ const kinds = await page
+ .getByTestId('memory-add-source-kind')
+ .locator('option')
+ .evaluateAll(options => options.map(option => (option as HTMLOptionElement).value));
+ expect(kinds).toEqual(['folder', 'file']);
await page.getByTestId('memory-add-source-target').fill('/Users/e2e/notes');
await page.getByTestId('memory-add-source-submit').click();
await expect(page.getByTestId('memory-add-source')).toBeHidden();
- const row = page.getByTestId('memory-source-src-2');
+ const row = page.getByTestId('memory-source-src-1');
await expect(row).toBeVisible();
await expect(row).toContainText('/Users/e2e/notes');
expect(fake.paramsOf('memory_sources_add')).toEqual([
{ kind: 'folder', target: '/Users/e2e/notes' },
]);
- // 5. Background: the pending belief build runs on demand.
- await page.getByTestId('brain-tab-background').click();
- await expect(page.getByTestId('memory-job-job-1')).toBeVisible();
- await page.getByTestId('memory-jobs-run-all').click();
- await expect(page.getByTestId('memory-run-job-1-outcome')).toContainText('Done');
- await expect(page.getByTestId('memory-jobs-empty')).toBeVisible();
- expect(fake.paramsOf('memory_jobs_run')).toEqual([{}]);
+ // 4. Upload: pasted text is ingested.
+ await page.getByTestId('memory-brain-add').click();
+ await page.getByTestId('memory-brain-ingest-text').fill('# Notes');
+ await page.getByTestId('memory-brain-ingest-submit').click();
+ await expect(page.getByTestId('memory-brain-notice')).toBeVisible();
+ expect(fake.paramsOf('memory_brain_ingest')).toEqual([{ text: '# Notes' }]);
});
test('importing previous memory needs explicit consent', async ({ page }) => {
const fake = await installMemoryFake(page, { engineOn: true, importFound: true });
await bootAuthenticatedPage(page, 'pw-memory-v2-import');
- await openMemory(page, '&brain=migration');
+ await openMemory(page, '&brain=brain');
// 6. The scan found v1 data: the banner offers it with the counts.
const banner = page.getByTestId('memory-import-banner');
@@ -534,9 +423,9 @@ test.describe('Memory v2 — engine active', () => {
).toBeVisible();
await expect(page.getByTestId('memory-import-done')).toBeVisible({ timeout: 15_000 });
- // The import lives on Migration only; other chips carry no banner.
- await page.getByTestId('brain-tab-ask').click();
- await expect(page.getByTestId('memory-ask-tab')).toBeVisible();
+ // The import lives on Files only; other chips carry no banner.
+ await page.getByTestId('brain-tab-conversations').click();
+ await expect(page.getByTestId('memory-conversations-tab')).toBeVisible();
await expect(page.getByTestId('memory-import-banner')).toHaveCount(0);
});
@@ -547,7 +436,7 @@ test.describe('Memory v2 — engine active', () => {
importFinishedWithFailed: 2,
});
await bootAuthenticatedPage(page, 'pw-memory-v2-import-retry');
- await openMemory(page, '&brain=migration');
+ await openMemory(page, '&brain=brain');
// Finished, with the refused items counted and a retry beside them.
await expect(page.getByTestId('memory-import-failed-items')).toContainText('imported: 2', {
@@ -574,7 +463,7 @@ test.describe('Memory v2 — engine active', () => {
importStoppedWith: stopped,
});
await bootAuthenticatedPage(page, 'pw-memory-v2-import-resume');
- await openMemory(page, '&brain=migration');
+ await openMemory(page, '&brain=brain');
// The stopped import shows its reason and a Resume control, not the fresh offer.
const failed = page.getByTestId('memory-import-error');
@@ -605,12 +494,18 @@ test.describe('Memory v2 — engine active', () => {
await bootAuthenticatedPage(page, 'pw-memory-v2-legacy');
const cases: Array<[string, RegExp]> = [
- ['/#/brain?tab=graph', /^#\/connections\?tab=brain&brain=ask(?:&|$)/],
+ ['/#/brain?tab=graph', /^#\/connections\?tab=brain&brain=conversations(?:&|$)/],
['/#/brain?tab=sources', /^#\/connections\?tab=brain&brain=brain(?:&|$)/],
[`${MEMORY_URL}&brain=sync`, /^#\/connections\?tab=brain&brain=brain(?:&|$)/],
['/#/settings/memory-engine', /^#\/connections\?tab=brain&brain=engine(?:&|$)/],
['/#/settings/memory-data', /^#\/connections\?tab=brain&brain=brain(?:&|$)/],
- ['/#/settings/memory-debug', /^#\/connections\?tab=brain&brain=ask(?:&|$)/],
+ ['/#/settings/memory-debug', /^#\/connections\?tab=brain&brain=conversations(?:&|$)/],
+ [`${MEMORY_URL}&brain=migration`, /^#\/connections\?tab=brain&brain=brain(?:&|$)/],
+ [`${MEMORY_URL}&brain=ask`, /^#\/connections\?tab=brain&brain=conversations(?:&|$)/],
+ [`${MEMORY_URL}&brain=explorer`, /^#\/connections\?tab=brain&brain=conversations(?:&|$)/],
+ [`${MEMORY_URL}&brain=learnings`, /^#\/connections\?tab=brain&brain=conversations(?:&|$)/],
+ [`${MEMORY_URL}&brain=background`, /^#\/connections\?tab=brain&brain=conversations(?:&|$)/],
+ [`${MEMORY_URL}&brain=settings`, /^#\/connections\?tab=brain&brain=conversations(?:&|$)/],
];
for (const [from, to] of cases) {
await page.goto(from);
@@ -637,15 +532,16 @@ test.describe('Memory v2 — memory off', () => {
// A content chip explains memory is off and points back to Engine.
await page.goto(`${MEMORY_URL}&brain=brain`);
await expect(page.getByTestId('memory-off-state')).toBeVisible({ timeout: 20_000 });
- await expect(page.getByTestId('memory-brain-tab')).toHaveCount(0);
+ await expect(page.getByTestId('memory-brain-add')).toHaveCount(0);
await page.getByTestId('memory-off-open-engine').click();
await expect.poll(() => hash(page)).toContain('brain=engine');
await expect(page.getByTestId('memory-engine-tab')).toBeVisible();
- // Migration explains memory is off too, instead of offering an import.
- await page.getByTestId('brain-tab-migration').click();
- await expect(page.getByTestId('memory-migration-tab')).toBeVisible();
+ // Files explains memory is off too, instead of offering an import or upload.
+ await page.getByTestId('brain-tab-brain').click();
+ await expect(page.getByTestId('memory-brain-tab')).toBeVisible();
await expect(page.getByTestId('memory-off-state')).toBeVisible();
+ await expect(page.getByTestId('memory-brain-add')).toHaveCount(0);
// With memory off the page never offers an import or lists sources.
expect(fake.paramsOf('memory_import_scan')).toEqual([]);
@@ -669,7 +565,7 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
test('TinyHumans connects with one click when signed in', async ({ page }) => {
const fake = await installMemoryFake(page, { engineOn: false });
await bootAuthenticatedPage(page, 'pw-memory-engine-builtin');
- // Stay on Engine: with no `?brain=` the page moves to Ask once memory is on.
+ // Stay on Engine: with no `?brain=` the page opens on Provider.
await openMemory(page, '&brain=engine');
// Nothing connected: the card opens on TinyHumans, one click away.
@@ -684,7 +580,7 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
test('CortexDB with your API key connects with only a key', async ({ page }) => {
const fake = await installMemoryFake(page, { engineOn: false });
await bootAuthenticatedPage(page, 'pw-memory-engine-apikey');
- // Stay on Engine: with no `?brain=` the page moves to Ask once memory is on.
+ // Stay on Engine: with no `?brain=` the page opens on Provider.
await openMemory(page, '&brain=engine');
await page.getByTestId('memory-engine-apikey').click();
@@ -704,7 +600,7 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
test('CortexDB Local refuses a non-local endpoint and connects a local one', async ({ page }) => {
const fake = await installMemoryFake(page, { engineOn: false });
await bootAuthenticatedPage(page, 'pw-memory-engine-selfhost');
- // Stay on Engine: with no `?brain=` the page moves to Ask once memory is on.
+ // Stay on Engine: with no `?brain=` the page opens on Provider.
await openMemory(page, '&brain=engine');
await page.getByTestId('memory-engine-selfhost').click();
@@ -762,62 +658,37 @@ test.describe('Memory v2 — Engine tab connect flows', () => {
});
test.describe('Memory v2 — out of credits', () => {
- test('a recall out of credits prompts a top-up that lands on billing', async ({ page }) => {
+ test('an upload out of credits prompts a top-up that lands on billing', async ({ page }) => {
const fake = await installMemoryFake(page, {
engineOn: true,
- failWith: { memory_recall: OUT_OF_CREDITS },
+ failWith: { memory_brain_ingest: OUT_OF_CREDITS },
});
- await bootAuthenticatedPage(page, 'pw-memory-v2-credits-ask');
- await openMemory(page);
+ await bootAuthenticatedPage(page, 'pw-memory-v2-credits-upload');
+ await openMemory(page, '&brain=brain');
- await page.getByTestId('brain-tab-ask').click();
- await page.getByTestId('memory-ask-input').fill('When does Atlas migrate?');
- await page.getByTestId('memory-ask-submit').click();
+ await page.getByTestId('memory-brain-add').click({ timeout: 20_000 });
+ await page.getByTestId('memory-brain-ingest-text').fill('# Notes');
+ await page.getByTestId('memory-brain-ingest-submit').click();
// A prompt, not an error: warning variant, the top-up explanation, no raw 402.
- const prompt = page.getByTestId('memory-ask-error');
+ const prompt = page.getByTestId('memory-brain-ingest-error');
await expect(prompt).toHaveAttribute('data-kind', 'out-of-credits', { timeout: 20_000 });
await expect(prompt).toHaveAttribute('data-variant', 'warning');
await expect(prompt).toContainText('Out of credits');
- await expect(prompt).toContainText('nothing stored has been lost');
await expect(prompt).not.toContainText('HTTP 402');
- expect(fake.paramsOf('memory_recall')).toEqual([{ question: 'When does Atlas migrate?' }]);
+ expect(fake.paramsOf('memory_brain_ingest')).toEqual([{ text: '# Notes' }]);
// Top up goes to the billing page.
await page.getByTestId('memory-top-up').click();
await expect.poll(() => hash(page)).toContain('#/settings/account');
});
-
- test('the Explorer keeps Try again beside Top up', async ({ page }) => {
- const fake = await installMemoryFake(page, {
- engineOn: true,
- failWith: { memory_explore: OUT_OF_CREDITS },
- });
- await bootAuthenticatedPage(page, 'pw-memory-v2-credits-explorer');
- await openMemory(page, '&brain=explorer');
-
- const prompt = page.getByTestId('memory-explorer-error');
- await expect(prompt).toHaveAttribute('data-kind', 'out-of-credits', { timeout: 20_000 });
- await expect(prompt.getByTestId('memory-top-up')).toBeVisible();
- const retry = prompt.getByRole('button', { name: 'Try again' });
- await expect(retry).toBeVisible();
-
- // Try again re-runs the load (it fails again here: still out of credits).
- const before = fake.paramsOf('memory_explore').length;
- await retry.click();
- await expect.poll(() => fake.paramsOf('memory_explore').length).toBeGreaterThan(before);
- await expect(page.getByTestId('memory-explorer-error')).toHaveAttribute(
- 'data-kind',
- 'out-of-credits'
- );
- });
});
test.describe('Memory v2 — move into the per-user layout', () => {
test('migrate now moves the legacy memory and the banner goes away', async ({ page }) => {
const fake = await installMemoryFake(page, { engineOn: true, migration: { shared: false } });
await bootAuthenticatedPage(page, 'pw-memory-v2-migrate');
- await openMemory(page, '&brain=migration');
+ await openMemory(page, '&brain=brain');
await expect(page.getByTestId('memory-migration-offer')).toBeVisible({ timeout: 20_000 });
await page.getByTestId('memory-migration-start').click();
@@ -828,7 +699,7 @@ test.describe('Memory v2 — move into the per-user layout', () => {
test('a tree other accounts may share is taken only after consent', async ({ page }) => {
const fake = await installMemoryFake(page, { engineOn: true, migration: { shared: true } });
await bootAuthenticatedPage(page, 'pw-memory-v2-migrate-takeover');
- await openMemory(page, '&brain=migration');
+ await openMemory(page, '&brain=brain');
await page.getByTestId('memory-migration-start').click({ timeout: 20_000 });
const takeover = page.getByTestId('memory-migration-takeover');
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.toml
index bef4275f5e..6d4b7a016d 100644
--- a/crates/openhuman-core/Cargo.toml
+++ b/crates/openhuman-core/Cargo.toml
@@ -212,7 +212,7 @@ tinyruntime-pyserver = { path = "../../vendor/tinyruntime/crates/tinyruntime-pys
# `memory::` is the only module that names the engine side.
tinymemory-api = { path = "../../vendor/tinymemory/crates/tinymemory-api" }
tinymemory-tools = { path = "../../vendor/tinymemory/crates/tinymemory-tools" }
-tinymemory-integrations = { path = "../../vendor/tinymemory/crates/tinymemory-integrations", default-features = false, features = ["cortex", "brain", "sources-network", "safety", "legacy-import"] }
+tinymemory-integrations = { path = "../../vendor/tinymemory/crates/tinymemory-integrations", default-features = false, features = ["cortex", "brain", "sources", "safety", "legacy-import"] }
# tinyconnectors-bus — the OAuth connector wire contract
# (https://github.com/tinyhumansai/tinyconnectors). Payload types and member
# names for the connector surface, with no transport and no behaviour: this
diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rs
index 7348eda23f..01377a8113 100644
--- a/crates/openhuman-core/src/core/runtime/services.rs
+++ b/crates/openhuman-core/src/core/runtime/services.rs
@@ -207,8 +207,6 @@ pub fn spawn_channels_service() {
/// [`start_bootstrap_jobs`] launches. Each field maps 1:1 to one spawn site.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) struct BootstrapJobPlan {
- /// Composio periodic connection sync (`composio::start_periodic_sync`).
- pub composio_integration_sync: bool,
/// Memory background work: seed memory's cron jobs and recover source
/// sync state an interrupted process left `syncing`.
pub memory_jobs: bool,
@@ -221,17 +219,14 @@ pub(crate) struct BootstrapJobPlan {
/// Pure flag→job mapping for [`start_bootstrap_jobs`]. No side effects.
///
-/// Note the Composio integration sync AND the one-shot Composio source reconcile
-/// both ride `services.integrations` — both no-op without active Composio
-/// connections, so they share the one concern flag. `channels` gates NO
-/// bootstrap job (its remaining meaning is exactly `spawn_channels_service`).
+/// `channels` gates NO bootstrap job (its remaining meaning is exactly
+/// `spawn_channels_service`).
pub(crate) fn bootstrap_job_plan(services: &ServiceSet) -> BootstrapJobPlan {
BootstrapJobPlan {
- composio_integration_sync: services.integrations,
memory_jobs: services.memory_sync,
task_source_pollers: services.cron,
- // Module preload is background boot work like the integrations sync
- // and rides the same flag.
+ // Module preload is background boot work and rides the integrations
+ // flag.
module_preload: services.integrations,
}
}
@@ -262,20 +257,11 @@ pub fn start_bootstrap_jobs(services: ServiceSet, config: &Config) {
log::debug!("[runtime.bootstrap] native module preload disabled by ServiceSet");
}
- // Integrations — no bootstrap job. Composio → memory syncs run on memory
- // source schedules (`memory::sources`), not a host loop here.
- if plan.composio_integration_sync {
- log::debug!(
- "[runtime.bootstrap] composio integrations enabled; memory syncs run on memory source schedules"
- );
- } else {
- log::debug!("[runtime.bootstrap] composio integrations disabled by ServiceSet");
- }
-
// Memory: seed the `memory_context_refresh` / `memory_sources_sync` cron
// jobs (idempotent) and mark sources a killed process left `syncing` idle.
if plan.memory_jobs {
crate::memory::sources::state::reset_interrupted(&config.workspace_dir);
+ crate::memory::sources::state::remove_orphaned_connector_files(&config.workspace_dir);
if let Err(error) = crate::cron::system_jobs::ensure_memory_jobs(config) {
log::warn!("[runtime.bootstrap] seeding memory cron jobs failed: {error}");
}