Skip to content

feat(memory): ingest Codex and Claude coding sessions - #4863

Merged
senamakel merged 34 commits into
tinyhumansai:mainfrom
senamakel:feat/tinycortex-session-ingestion
Jul 16, 2026
Merged

feat(memory): ingest Codex and Claude coding sessions#4863
senamakel merged 34 commits into
tinyhumansai:mainfrom
senamakel:feat/tinycortex-session-ingestion

Conversation

@senamakel

@senamakel senamakel commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Update the vendor/tinycortex submodule from 671e78a to 9a0603a and adapt OpenHuman to its transactional queue, query, summary-context, and TinyAgents v2 API changes.
  • Add privacy-scoped discovery and incremental/backfill persona ingestion for human-authored Codex and Claude Code session turns.
  • Expose typed JSON-RPC status/ingest controllers and a localized Brain > Sources card with progress and error feedback.
  • Add Rust unit/feature/RPC integration, Vitest, WDIO, and Playwright coverage plus the feature-catalog and coverage-matrix entries.

Problem

  • OpenHuman was pinned to an older TinyCortex revision and did not expose the new Codex/Claude session readers or persona pipeline.
  • Updating the vendor pin alone breaks host integrations because several upstream APIs and the nested TinyAgents dependency changed.

Solution

  • Enable TinyCortex persona support and add an OpenHuman adapter that scans the standard Claude/Codex roots, filters assistant/developer/sidechain traffic, bounds each run, and stores pipeline state in the internal workspace.
  • Run the non-Send persona pipeline safely from a blocking worker attached to the ambient Tokio runtime, reusing the configured OpenHuman inference provider and summarizer.
  • Preserve atomic memory ingest by delegating queue writes to TinyCortex’s transaction-aware QueueJobSink implementation.
  • Disclose that distilled evidence can leave the device for the configured inference provider; logs contain counts and stable prefixes, not paths, content, or secrets.

Submission Checklist

If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
  • Diff coverage ≥ 80% — changed lines are covered across Rust fixtures/RPC, Vitest service/component tests, WDIO, and Playwright; the authoritative merged diff-cover gate is delegated to CI.
  • Coverage matrix updated — feature 8.2.5 documents the new coding-session persona ingestion surface and all test layers.
  • All affected feature IDs from the matrix are listed in the PR description under ## Related.
  • No new external network dependencies introduced; ingestion reuses the configured inference provider and tests use fixtures/mocks.
  • N/A: this does not alter release-cut installation, signing, update, or OS-permission surfaces, so the manual smoke checklist is unchanged.
  • N/A: no tracking issue was supplied for this requested integration.

Impact

  • Desktop Brain > Sources gains Codex and Claude Code discovery/ingestion. The core RPC is also available to headless clients when the memory-sources domain is enabled.
  • Incremental state is persisted under the OpenHuman internal workspace. Backfill is opt-in and each request is capped at 1,000 sessions/LLM calls.
  • Raw session text is read locally; only distilled evidence sent through the configured inference provider may leave the device, as recorded in the feature catalog.
  • Both root and Tauri lockfiles now intentionally contain TinyAgents 1.9 for OpenHuman and TinyAgents 2.0 for current TinyCortex.

Related

  • Feature ID: 8.2.5
  • Closes: N/A — no issue supplied
  • Follow-up PR(s)/TODOs: N/A

AI Authored PR Metadata (required for Codex/Linear PRs)

Keep this section for AI-authored PRs. For human-only PRs, mark each field N/A.

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: feat/tinycortex-session-ingestion
  • Commit SHA: 92c309cd0

Validation Run

  • pnpm --filter openhuman-app format:check
  • pnpm typecheck
  • Focused tests: pnpm debug unit src/components/intelligence/__tests__/CodingSessionsCard.test.tsx src/services/memorySourcesService.test.ts (16 passed); fixture-based Rust code fully typechecked; runtime Rust/E2E suites delegated to Actions.
  • Rust fmt/check: cargo fmt --all -- --check; cargo check --lib; pre-push cargo check --manifest-path app/src-tauri/Cargo.toml.
  • Tauri fmt/check: pre-push gate passed.

Validation Blocked

  • pnpm i18n:english:check: reports the repository’s existing untranslated-string backlog; the new keys pass locale parity and add real translations in all locales.
  • tsc -p app/test/tsconfig.e2e.json: local install lacks @wdio/globals/types; WDIO/Playwright compilation and execution are delegated to Actions.
  • Full Rust, coverage, WDIO, and Playwright suites: intentionally deferred to GitHub Actions per request because this host is slow; the config/lockfile changes trigger the full relevant CI lanes.
  • impact: No known product blocker; CI is authoritative for the deferred suites.

Behavior Changes

  • Intended behavior change: ingest human-authored Codex/Claude coding-session evidence into TinyCortex persona memory.
  • User-visible effect: Brain > Sources shows both session sources and an incremental ingest action with localized status/toasts.

Parity Contract

  • Legacy behavior preserved: existing TinyCortex memory ingest/search/tree behavior remains registered and passes updated compile contracts.
  • Guard/fallback/dispatch parity checks: machine-authored Codex developer turns and Claude sidechain turns are excluded; unavailable roots report status without failing; invalid hybrid profiles return a clear error.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): None found for this exact head branch.
  • Canonical PR: This PR.
  • Resolution (closed/superseded/updated): N/A

Summary by CodeRabbit

  • New Features
    • Added coding-agent session memory to scan and ingest local Claude Code and Codex histories, including progress and truncated-scan messaging.
    • Added a Sources-tab card with per-provider availability, session/evidence totals, ingest control, and success/warning/error toasts.
  • Localization
    • Added translations for the new coding-session memory UI.
  • Bug Fixes
    • Fixed custom memory category handling to keep custom: values consistent.
  • Testing
    • Added/expanded unit, integration, end-to-end, and Playwright coverage for discovery and ingestion.
  • Chores
    • Improved CI/release builds by recursively initializing vendored TinyCortex submodules.

@senamakel
senamakel requested a review from a team July 14, 2026 14:05
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds coding-session memory ingestion for Claude Code and Codex, including TinyCortex scanning, RPC APIs, Sources UI, localization, privacy metadata, tests, recursive CI submodule initialization, and compatibility updates.

Changes

Coding-session memory

Layer / File(s) Summary
Session discovery and TinyCortex ingestion
src/openhuman/tinycortex/*, tests/coding_sessions_feature.rs, Cargo.toml, vendor/tinycortex
Discovers and filters local sessions, runs persona ingestion, and wires transaction-aware extraction enqueueing.
Memory-sources RPC contracts
src/openhuman/memory_sources/*, app/src/services/memorySourcesService.*, tests/json_rpc_e2e.rs
Registers endpoints, implements RPC execution, exposes typed frontend wrappers, and tests request and response shapes.
Sources tab coding-session card
app/src/components/intelligence/*, app/src/pages/Brain.tsx, app/src/lib/i18n/*, app/test/*, docs/TEST-COVERAGE-MATRIX.md
Adds localized status and ingestion UI with counts, controls, toasts, browser tests, and coverage entries.
Capability and privacy catalog
src/openhuman/about_app/*
Registers coding-session memory as a beta capability with raw-data privacy metadata.
Compatibility updates
src/openhuman/agent/*, src/openhuman/memory*, src/openhuman/tinycortex/parity.rs
Updates summarization budgets, category wire-format handling, tree fixtures, query offsets, search-mode validation, and storage behavior.
Recursive vendored submodule initialization
.github/workflows/*
Enables recursive initialization of vendored submodules in test and release workflows.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related issues

  • tinyhumansai/backend#1077: Covers a related Claude Code/Codex session ingestion pipeline.
  • tinyhumansai/openhuman#4806: Covers the TinyCortex-based coding-session ingestion and integration-test work.

Possibly related PRs

Suggested labels: feature, memory, rust-core

Suggested reviewers: m3ga-mind, oxoxdev

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CodingSessionsCard
  participant MemorySourcesService
  participant MemorySourcesRPC
  participant TinyCortexPersona
  User->>CodingSessionsCard: open Sources tab
  CodingSessionsCard->>MemorySourcesService: request session status
  MemorySourcesService->>MemorySourcesRPC: call coding_session_status
  MemorySourcesRPC->>TinyCortexPersona: scan local session roots
  TinyCortexPersona-->>CodingSessionsCard: return source counts
  User->>CodingSessionsCard: click Ingest
  CodingSessionsCard->>MemorySourcesService: request ingestion
  MemorySourcesService->>MemorySourcesRPC: call ingest_coding_sessions
  MemorySourcesRPC->>TinyCortexPersona: run persona pipeline
  TinyCortexPersona-->>CodingSessionsCard: return ingestion metrics
Loading

Poem

A rabbit scans sessions bright,
Claude and Codex hop into sight.
TinyCortex gathers each clue,
Localized carrots bloom anew.
Recursive builds leap into flight. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: ingesting Codex and Claude coding sessions in the memory subsystem.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eff1f788a0

ℹ️ 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".

Comment thread src/openhuman/tinycortex/persona.rs Outdated
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f0fa4fe08

ℹ️ 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".

Comment thread src/openhuman/tinycortex/persona.rs Outdated
@M3gA-Mind

Copy link
Copy Markdown
Collaborator

Re @chatgpt-codex-connector's P2 follow-up on persona.rs"Cap discovery before collecting all session paths": declining in this PR, with reasoning + a tracked follow-up.

The suggested fix (pass the cap into discovery / stop traversal once the limit is reached) has to change claude_code::discover / codex::discover, which live in the vendored tinycortex crate (tinycortex::memory::persona::readers::{claude_code,codex}), not in this openhuman PR's editable code — this PR only bumps the vendor/tinycortex submodule pointer. Bounding traversal inside discover is a change to the tinycortex crate itself (separate repo/submodule, its own PR + CI), so it can't be landed cleanly or verified from this openhuman-side fix pass. Reimplementing a bounded readdir in persona.rs instead would duplicate and risk diverging from each reader's own path-selection semantics (which subtrees / extensions count), so that's the wrong layer to fix it at.

Two things bound the blast radius today:

  • The expensive work is already capped. The author's 6f0fa4fe0 truncates to MAX_STATUS_SESSION_FILES = 1_000 before the read/parse loop (persona.rs:69-93), so at most 1,000 files are ever read+parsed and a scan_truncated signal is emitted. The residual is only the Vec<PathBuf> allocation from discovery — the cheap part relative to parsing — which is why this is P2, not P1.
  • Discovery is a per-source path list, not a full recursive content walk.

Right fix: add a bounded discover(root, max) (or early-stop) to the tinycortex persona readers and re-pin — I'd suggest tracking that as a follow-up against the tinycortex crate rather than blocking this PR, which CodeRabbit has already approved. Happy to file it if the maintainer agrees.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

…refix

The tinycortex bump in this PR changes MemoryCategory's wire/Display format so
Custom(name) renders as `custom:{name}` (keeping Custom("core") distinct from
Core). The store persists a category via its Display form, but the read helper
`memory_category_from_stored` wrapped the raw stored string in Custom(_) without
stripping the prefix, so a round-trip produced Custom("custom:project") instead
of Custom("project") — breaking memory::tools::store::store_with_custom_category.
Parse back through FromStr (the true inverse of Display) so the prefix is stripped
symmetrically. Also update the stale memory_category_display_outputs_expected_values
test to the new custom: Display form.
@M3gA-Mind

Copy link
Copy Markdown
Collaborator

Maintainer fix pass — pushed 313e7c35d.

CI: Rust Core Coverage (was RED) → fixed. Two core tests failed:

  • memory::tools::store::tests::store_with_custom_categoryCustom("custom:project") vs expected Custom("project").
  • memory::traits::tests::memory_category_display_outputs_expected_values.

Root cause: the vendor/tinycortex bump in this PR (→ 9a0603afb, audit-remediation #74) changed MemoryCategory's wire/Display format so Custom(name) renders as custom:{name} (keeping Custom("core") distinct from Core; Display/FromStr are now true inverses). The store persists a category via its Display form, but the read helper memory_category_from_stored (memory_store/memory_trait.rs:48) wrapped the raw stored string in Custom(_) without stripping the prefix — so a round-trip double-prefixed to Custom("custom:project"). Old bare-name Display hid the asymmetry.

Fix (source-only, submodule pin untouched):

  • memory_store/memory_trait.rsmemory_category_from_stored now parses through FromStr (the inverse of Display), stripping custom: symmetrically; empty falls back to Custom("") as before. This is the single read-side conversion (3 call sites), so it fixes all read paths.
  • memory/traits.rs — updated the stale Display test to expect custom:project_notes.

Codex P2 (persona.rs:71, "cap discovery before collecting all session paths") — declining here, belongs in tinycortex. The concern is valid (claude_code::discover/codex::discover use a recursive WalkDir::new(root).…collect() with no early-exit, so a huge ~/.codex/sessions tree is fully walked before the 1,000-file cap truncates). But those discover functions live in the vendored tinycortex crate (tinycortex::memory::persona::readers::{claude_code,codex}), not in this repo — the openhuman-side source_status only receives an impl Fn(&Path) -> Vec<PathBuf> that already returns the full Vec, so it cannot early-exit without either (a) modifying vendored tinycortex + re-bumping the submodule, or (b) reimplementing bounded discovery in core and diverging from the readers' session-detection semantics. The openhuman status path already caps the expensive step (parsing) at 1,000 files (6f0fa4fe0). Recommend a tinycortex follow-up adding discover_capped(root, limit) with a WalkDir early-exit, then a small openhuman bump to consume it — out of scope for this PR's fix pass. (The first Codex P2 at line 70 was already fixed by the author in 6f0fa4fe0.)

@coderabbitai coderabbitai Bot added feature Net-new user-facing capability or product behavior. memory Memory store, memory tree, recall, summarization, and embeddings in src/openhuman/memory/. labels Jul 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92c309cd08

ℹ️ 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".

Comment thread src/openhuman/memory/traits.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (5)
src/openhuman/memory_search/tools/hybrid_search.rs (1)

113-118: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add diagnostics and regression coverage for invalid modes.

This new error branch should emit a grep-friendly diagnostic containing the rejected mode before returning, and have a test asserting that unknown modes fail without reaching the external search path.

As per coding guidelines, changed Rust flows must include verbose diagnostics and maintain coverage on changed lines.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/memory_search/tools/hybrid_search.rs` around lines 113 - 118,
Update the invalid-mode branch in the hybrid search flow around
WeightProfile::by_name to emit a grep-friendly diagnostic containing the
rejected mode before returning the error. Add regression coverage that submits
an unknown mode, verifies the failure includes that mode, and confirms the
external search path is not invoked.

Source: Coding guidelines

src/openhuman/tinycortex/ingest.rs (2)

9-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unused Config param forces a pointless clone at the call site.

new takes _config: Config by value but never uses it, yet context() (unchanged, line 58) still does HostTreeJobSink::new(config.clone()) — cloning Config purely to discard it. Since the sink no longer holds config state, consider dropping the parameter (and updating the one call site) or accepting &Config if it must stay for API symmetry with other constructors.

♻️ Suggested cleanup
 impl HostTreeJobSink {
-    pub fn new(_config: Config) -> Self {
+    pub fn new() -> Self {
         Self
     }
 }

And update the call site: HostTreeJobSink::new() instead of HostTreeJobSink::new(config.clone()).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/tinycortex/ingest.rs` around lines 9 - 15, Remove the unused
Config parameter from HostTreeJobSink::new and update context() to call
HostTreeJobSink::new() without cloning config. Keep HostTreeJobSink stateless
and preserve its existing construction behavior.

17-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

No outcome/error diagnostics for the enqueue branch.

The trace log fires before the DB-transaction call but the returned bool (enqueued vs. already-queued) and any error path from QueueJobSink.enqueue_extract_tx aren't logged. As per coding guidelines, "New or changed flows must include verbose, grep-friendly diagnostics for entry/exit, branches, external calls, retries/timeouts, state transitions, and errors" — this changed flow only covers entry.

♻️ Suggested addition
-        QueueJobSink.enqueue_extract_tx(tx, chunk_id, default_max_attempts)
+        let outcome = QueueJobSink.enqueue_extract_tx(tx, chunk_id, default_max_attempts);
+        if let Ok(enqueued) = &outcome {
+            tracing::trace!(chunk_id, enqueued, "[memory:ingest] enqueue extract job outcome");
+        }
+        outcome
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/tinycortex/ingest.rs` around lines 17 - 30, The
enqueue_extract_tx flow in HostTreeJobSink logs only entry, not the QueueJobSink
outcome or errors. Update HostTreeJobSink::enqueue_extract_tx to capture the
delegated result, log whether the job was enqueued or already queued on success,
and emit an error diagnostic when QueueJobSink.enqueue_extract_tx fails before
returning the original result.

Source: Coding guidelines

app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx (1)

18-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing tests for the error/failure paths in CodingSessionsCard.

All three tests cover only success paths (status load succeeds, ingest succeeds, ingest disabled). Neither getCodingSessionStatus nor ingestCodingSessions rejection paths are exercised, leaving the catch blocks in CodingSessionsCard.tsx (status-fetch failure setting the role="alert" error text; ingest failure firing the error toast) untested.

✅ Suggested test additions
+  it('shows an error when status fetch fails', async () => {
+    mockedStatus.mockRejectedValue(new Error('boom'));
+    renderWithProviders(<CodingSessionsCard />);
+    expect(await screen.findByRole('alert')).toHaveTextContent('boom');
+  });
+
+  it('reports a toast when ingest fails', async () => {
+    mockedIngest.mockRejectedValue(new Error('ingest failed'));
+    const onToast = vi.fn();
+    renderWithProviders(<CodingSessionsCard onToast={onToast} />);
+    fireEvent.click(await screen.findByTestId('coding-sessions-ingest'));
+    await waitFor(() =>
+      expect(onToast).toHaveBeenCalledWith(expect.objectContaining({ type: 'error' }))
+    );
+  });

Based on path instructions, "Untested code is incomplete; changes should maintain at least 80% coverage on changed lines."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx` around
lines 18 - 82, Add tests in the CodingSessionsCard suite for
getCodingSessionStatus rejection, asserting the status-fetch catch path renders
the expected role="alert" error text, and for ingestCodingSessions rejection,
asserting the error toast is fired through onToast. Keep the existing success
and disabled-path tests unchanged.

Source: Path instructions

app/src/components/intelligence/CodingSessionsCard.tsx (1)

108-126: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

scan_truncated from the status payload is never surfaced to the user.

CodingSessionSourceStatus exposes an optional scan_truncated flag (per memorySourcesService.ts), presumably set when the 1,000-session processing cap mentioned in the PR objectives is hit. This card renders only session_files/evidence_units per source and never checks or displays scan_truncated, so a user whose scan was capped has no indication that some local sessions weren't counted/ingested.

♻️ Suggested addition
             <div className="mt-1 text-xs text-content-secondary">
               {source.available
                 ? t('memorySources.codingSessions.counts')
                     .replace('{files}', String(source.session_files))
                     .replace('{evidence}', String(source.evidence_units))
                 : t('memorySources.codingSessions.notFound')}
             </div>
+            {source.available && source.scan_truncated && (
+              <div className="mt-1 text-xs text-amber-600 dark:text-amber-400">
+                {t('memorySources.codingSessions.truncated')}
+              </div>
+            )}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/components/intelligence/CodingSessionsCard.tsx` around lines 108 -
126, Update the source rendering in CodingSessionsCard to check each
CodingSessionSourceStatus entry’s optional scan_truncated flag and visibly
indicate when scanning was capped, while preserving the existing file/evidence
counts and not-found states. Use the existing translation mechanism and
memory-source localization keys for the truncation message.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/lib/i18n/ko.ts`:
- Line 7157: Update the memorySources.codingSessions.claude translation value to
the official product name “Claude Code,” matching the existing branding used
elsewhere in the locale and preserving consistent UI labels.

In `@app/src/lib/i18n/ru.ts`:
- Line 7319: Update the Russian `memorySources.codingSessions.counts` and the
adjacent count strings to use the project’s pluralization mechanism for each
interpolated count, or neutral wording that avoids inflected nouns; ensure
values such as 1, 2, and 21 render grammatically correct Russian labels.

In `@app/src/lib/i18n/zh-CN.ts`:
- Around line 6849-6850: Update the translation for
memorySources.codingSessions.counts in the Chinese locale so the evidence
placeholder is labeled neutrally as evidence units, such as “条证据” or “条证据单元”,
instead of “用户输入”; preserve the existing {files} and {evidence} placeholders.

In `@src/openhuman/memory_sources/rpc.rs`:
- Around line 34-60: Add a local wall-clock timeout around the `spawn_blocking`
join in `ingest_coding_sessions_rpc`, using the project’s established timeout
configuration or a dedicated bounded duration. Preserve the existing join and
ingestion error mapping, and return a clear timeout error when the budget
expires.

In `@src/openhuman/tinycortex/persona.rs`:
- Around line 148-220: Update ingest_coding_sessions to add grep-friendly error
diagnostics around build_chat_provider, FileStateStore::open_in_workspace, and
Pipeline::run before propagating their failures; preserve the existing ?-based
error propagation and include the relevant operation context in each log.

---

Nitpick comments:
In `@app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx`:
- Around line 18-82: Add tests in the CodingSessionsCard suite for
getCodingSessionStatus rejection, asserting the status-fetch catch path renders
the expected role="alert" error text, and for ingestCodingSessions rejection,
asserting the error toast is fired through onToast. Keep the existing success
and disabled-path tests unchanged.

In `@app/src/components/intelligence/CodingSessionsCard.tsx`:
- Around line 108-126: Update the source rendering in CodingSessionsCard to
check each CodingSessionSourceStatus entry’s optional scan_truncated flag and
visibly indicate when scanning was capped, while preserving the existing
file/evidence counts and not-found states. Use the existing translation
mechanism and memory-source localization keys for the truncation message.

In `@src/openhuman/memory_search/tools/hybrid_search.rs`:
- Around line 113-118: Update the invalid-mode branch in the hybrid search flow
around WeightProfile::by_name to emit a grep-friendly diagnostic containing the
rejected mode before returning the error. Add regression coverage that submits
an unknown mode, verifies the failure includes that mode, and confirms the
external search path is not invoked.

In `@src/openhuman/tinycortex/ingest.rs`:
- Around line 9-15: Remove the unused Config parameter from HostTreeJobSink::new
and update context() to call HostTreeJobSink::new() without cloning config. Keep
HostTreeJobSink stateless and preserve its existing construction behavior.
- Around line 17-30: The enqueue_extract_tx flow in HostTreeJobSink logs only
entry, not the QueueJobSink outcome or errors. Update
HostTreeJobSink::enqueue_extract_tx to capture the delegated result, log whether
the job was enqueued or already queued on success, and emit an error diagnostic
when QueueJobSink.enqueue_extract_tx fails before returning the original result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92660183-047c-4057-afe7-cd6cf91d67b3

📥 Commits

Reviewing files that changed from the base of the PR and between cb9d5e6 and 92c309c.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • app/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (50)
  • .github/workflows/ci-lite.yml
  • .github/workflows/release-production.yml
  • .github/workflows/release-staging.yml
  • .github/workflows/test-reusable.yml
  • Cargo.toml
  • app/src/components/intelligence/CodingSessionsCard.tsx
  • app/src/components/intelligence/__tests__/CodingSessionsCard.test.tsx
  • app/src/lib/i18n/ar.ts
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/en.ts
  • app/src/lib/i18n/es.ts
  • app/src/lib/i18n/fr.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/id.ts
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/ko.ts
  • app/src/lib/i18n/pl.ts
  • app/src/lib/i18n/pt.ts
  • app/src/lib/i18n/ru.ts
  • app/src/lib/i18n/zh-CN.ts
  • app/src/pages/Brain.tsx
  • app/src/services/memorySourcesService.test.ts
  • app/src/services/memorySourcesService.ts
  • app/test/e2e/specs/coding-session-memory.spec.ts
  • app/test/playwright/specs/coding-session-memory.spec.ts
  • docs/TEST-COVERAGE-MATRIX.md
  • src/openhuman/about_app/catalog_data.rs
  • src/openhuman/about_app/catalog_tests.rs
  • src/openhuman/agent/harness/archivist/recap.rs
  • src/openhuman/memory/traits.rs
  • src/openhuman/memory/tree_source/file.rs
  • src/openhuman/memory_search/tools/hybrid_search.rs
  • src/openhuman/memory_search/tools/vector_search.rs
  • src/openhuman/memory_sources/rpc.rs
  • src/openhuman/memory_sources/schemas.rs
  • src/openhuman/memory_store/memory_trait.rs
  • src/openhuman/memory_store/retrieval/mod.rs
  • src/openhuman/memory_store/tools/raw_chunks.rs
  • src/openhuman/memory_store/traits.rs
  • src/openhuman/memory_store/trees/store_tests.rs
  • src/openhuman/memory_tree/tree/registry.rs
  • src/openhuman/memory_tree/tree/rpc.rs
  • src/openhuman/tinycortex/ingest.rs
  • src/openhuman/tinycortex/mod.rs
  • src/openhuman/tinycortex/parity.rs
  • src/openhuman/tinycortex/persona.rs
  • tests/coding_sessions_feature.rs
  • tests/json_rpc_e2e.rs
  • vendor/tinycortex

Comment thread app/src/lib/i18n/ko.ts
Comment thread app/src/lib/i18n/ru.ts Outdated
Comment thread app/src/lib/i18n/zh-CN.ts Outdated
Comment thread src/openhuman/memory_sources/rpc.rs
Comment thread src/openhuman/tinycortex/persona.rs
Review (tinyhumansai#4863): this PR made Display/memory_recall emit the `custom:<name>`
wire form, but memory_store still wrapped any non-builtin string as
Custom(other), so echoing back `custom:project_notes` stored
Custom("custom:project_notes") — which Displays as custom:custom:project_notes
and no longer matches the original category on recall/filter. Route the custom
arm through FromStr (which strips the prefix and still accepts legacy bare
names), with a raw-string fallback. Adds a store-level round-trip regression.
@M3gA-Mind

Copy link
Copy Markdown
Collaborator

Maintainer fix pass

Synced onto fresh upstream/main (clean merge — the vendor/tinycortex gitlink stays at the PR's intended 9a0603af; main never moved it, so nothing was dropped).

Fixed — Codex P2 "Parse prefixed custom categories before storing" (memory/tools/store.rs, 003065b6)

This PR made Display/memory_recall emit the custom:<name> wire form, but memory_store still wrapped any non-builtin string as Custom(other) — so echoing back custom:project_notes stored Custom("custom:project_notes"), which Displays as custom:custom:project_notes and no longer matches the original category on recall/filter. Routed the custom arm through FromStr (which strips the custom: prefix and still accepts legacy bare names), with a raw-string fallback, plus a store-level round-trip regression test (store_strips_custom_prefix_from_wire_category).

Already fixed by author — Codex P2 "Cap status scans" (persona.rs)

Addressed in 6f0fa4fe0 (1,000-file cap + scan_truncated signal + test).

Declined-with-reason — Codex P2 "Cap discovery before collecting all session paths" (persona.rs:71)

Legitimate observation, but out of scope for this openhuman PR: the discover function is provided by the tinycortex crate (tinycortex::memory::persona::readers::{claude_code, codex}::discover), which returns a fully-materialized Vec<PathBuf>. Bounding traversal inside discovery (early-exit at the cap) requires changing the discover signature/impl in the tinycortex submodule — a separate repo/PR, not something the openhuman source_status caller can do without that upstream API change. The current openhuman-side max_files truncation still bounds the expensive per-file parse/read work; only the path-enumeration walk remains unbounded. Recommend tracking the discovery-level cap as a tinycortex follow-up (add a discover_capped(root, max) or a max param that stops traversal). Non-blocking Codex COMMENTED note, not a merge gate.

senamakel and others added 4 commits July 14, 2026 16:44
- memory_sources/rpc.rs: wrap ingest_coding_sessions in a budget-proportional
  tokio::time::timeout (120s + 30s/session, capped) so a stalled provider call
  can't keep the RPC waiting indefinitely, without killing a legit large
  backfill (CodeRabbit Major).
- tinycortex/persona.rs: add error-path tracing::error! diagnostics on the three
  fallible external calls (build_chat_provider, FileStateStore::open_in_workspace,
  Pipeline::run) via inspect_err (CodeRabbit Major — repo diagnostics convention).
- i18n ko/zh-CN/ru: restore 'Claude Code' product branding for the .claude label,
  and align the {evidence} count label to the canonical en semantics ('human
  turns') instead of 'user input'/'user messages' (CodeRabbit Minor).
The enqueue branch only traced entry; add the returned enqueued/already-queued
bool and an error-path diagnostic so the ingest flow is observable end-to-end
(CodeRabbit nitpick, repo diagnostics convention).
@M3gA-Mind

Copy link
Copy Markdown
Collaborator

Maintainer fix pass — addressed the 15:56 CodeRabbit review + the Codex P2:

Fixed (Major):

  • src/openhuman/memory_sources/rpc.rs — wrapped ingest_coding_sessions in a budget-proportional tokio::time::timeout (120s + 30s/session, capped at the 1,000-session limit) with an error log on elapse, so a stalled provider call can't keep the RPC/blocking worker waiting indefinitely, while a legit large backfill isn't killed mid-flight.
  • src/openhuman/tinycortex/persona.rs — added tracing::error! diagnostics via inspect_err on all three fallible external calls (build_chat_provider, FileStateStore::open_in_workspace, Pipeline::run) so a failure is observable at the source, not just as a bare string at the RPC boundary.

Fixed (Minor / nitpick):

  • src/openhuman/tinycortex/ingest.rs — the enqueue branch now logs the returned enqueued/already-queued bool and an error-path diagnostic.
  • i18n ko/zh-CN/ru — restored the Claude Code product name for the .claude label (was transliterated: 클로드 코드 / 克劳德代码 / Клод Код).
  • i18n zh-CN/ru .counts {evidence} label — aligned to the canonical en semantics. Note: the en source label (en.ts) is {evidence} human turns, so I used 轮人类对话 / ходов человека ("human turns") rather than CodeRabbit's suggested "evidence" (证据) — the field counts human turns, and "evidence" would drift from the source string. This also fixes the "user input / user messages" mislabel CodeRabbit flagged.

Declined-with-reason:

  • ru.ts strict Slavic pluralization of the count strings: no locale pluralizes this interpolated count — the canonical en itself renders a fixed form (1 sessions), as do all 14 locales. Adding per-count plural logic to only ru would break that deliberate, uniform simplification and create asymmetry with every other locale + the source. If the project wants proper CLDR plurals here, that's a cross-locale change to the shared counts/label strings, out of scope for this ingestion PR. I did fix the misleading-label half (→ "human turns").

Already addressed in HEAD (Codex P2, memory_store): the custom-category double-prefix (custom:custom:*) — the write path in memory/tools/store.rs already routes custom categories through FromStr (other.parse().unwrap_or_else(|_| Custom(raw))), so custom:project_notes stores as Custom("project_notes"). Verified against current HEAD.

Letting PR CI verify (no local matrix run).

@M3gA-Mind

Copy link
Copy Markdown
Collaborator

@coderabbitai review

All 5 items from the last review are addressed (ingestion timeout, persona error diagnostics, enqueue outcome/error logging, i18n branding + the {evidence} label aligned to the canonical en "human turns") — with the ru strict-pluralization point declined-with-reason (no locale pluralizes this count; en renders 1 sessions). Please re-review against current HEAD.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 29b1de84cb

ℹ️ 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".

Comment thread src/openhuman/agent/harness/session/turn/session_io.rs Outdated
Comment thread app/src/components/intelligence/CodingSessionsCard.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85514fb4d4

ℹ️ 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".

Comment thread src/openhuman/agent/harness/session/turn/session_io.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/openhuman/agent/harness/session/turn/session_io.rs`:
- Around line 170-180: Add correlated telemetry around the checkpoint selection
in the session turn flow: retain the existing tool-call warning, and add
branch/outcome logs for the successful text and streamed-text fallback paths
plus a final checkpoint outcome log. Include model and iteration_for_stream
correlation fields and only safe counts or text-length metrics, using stable
prefixes and avoiding content or sensitive data.
- Around line 163-180: Update the wrap-up checkpoint selection around
parse_tool_calls and the streamed_text fallback so streamed_text is also parsed
for tool calls before being returned. Treat parsed tool calls found in either
response text or streamed_text as attempted_tool_call, preserving the
deterministic empty-string fallback and existing checkpoint behavior for valid
plain text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82456f98-a7ee-4d42-a5c4-7a15bcbb5802

📥 Commits

Reviewing files that changed from the base of the PR and between b871d09 and 9af3c22.

📒 Files selected for processing (2)
  • src/openhuman/agent/harness/session/turn/session_io.rs
  • src/openhuman/memory_queue/worker.rs

Comment thread src/openhuman/agent/harness/session/turn/session_io.rs
Comment thread src/openhuman/agent/harness/session/turn/session_io.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ee940e8bb

ℹ️ 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".

Comment thread src/openhuman/tinycortex/persona.rs Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0131ec2314

ℹ️ 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".

Comment thread Cargo.toml
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b82ce6f9f

ℹ️ 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".

Comment thread src/openhuman/tinycortex/persona.rs
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026
…sion-ingestion

# Conflicts:
#	app/src/lib/i18n/ar.ts
#	app/src/lib/i18n/bn.ts
#	app/src/lib/i18n/de.ts
#	app/src/lib/i18n/es.ts
#	app/src/lib/i18n/fr.ts
#	app/src/lib/i18n/hi.ts
#	app/src/lib/i18n/id.ts
#	app/src/lib/i18n/it.ts
#	app/src/lib/i18n/ko.ts
#	app/src/lib/i18n/pl.ts
#	app/src/lib/i18n/pt.ts
#	app/src/lib/i18n/ru.ts
#	app/src/lib/i18n/zh-CN.ts
#	src/openhuman/flows/ops_tests.rs
#	tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs
…sion-ingestion

# Conflicts:
#	src/openhuman/agent/harness/session/turn/session_io.rs
#	src/openhuman/agent/harness/session/turn_tests.rs
#	tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3afa56a033

ℹ️ 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".

Comment thread app/src/components/intelligence/CodingSessionsCard.tsx
@senamakel
senamakel merged commit 0b48b67 into tinyhumansai:main Jul 16, 2026
18 checks passed
senamakel added a commit to M3gA-Mind/openhuman that referenced this pull request Jul 18, 2026
)

Co-authored-by: M3gA-Mind <elvin@tinyhumans.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Net-new user-facing capability or product behavior. memory Memory store, memory tree, recall, summarization, and embeddings in src/openhuman/memory/. rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants