-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(memory): ingest Codex and Claude coding sessions #4863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
senamakel
merged 34 commits into
tinyhumansai:main
from
senamakel:feat/tinycortex-session-ingestion
Jul 16, 2026
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
6db993e
feat(memory): ingest coding-agent sessions
senamakel eff1f78
chore(tauri): sync TinyCortex lockfile
senamakel e9035c2
ci: initialize nested TinyCortex submodules
senamakel 6f0fa4f
fix(memory): cap coding-session status scans
senamakel 974046f
Merge branch 'main' into pr/4863
M3gA-Mind 313e7c3
fix(memory): parse stored category through FromStr to strip custom: p…
M3gA-Mind 92c309c
fix(memory): parse TinyCortex custom categories
senamakel e726c5f
Merge branch 'main' into pr/4863
M3gA-Mind 003065b
fix(memory): strip custom: prefix when storing echoed wire categories
M3gA-Mind 73985a8
test(memory): include coding session controllers
senamakel 3cbb280
Merge branch 'main' into pr/4863
M3gA-Mind 8296d30
fix(memory): address review — ingestion timeout, error diagnostics, i18n
M3gA-Mind 998d297
fix(memory): log enqueue-extract outcome + error path
M3gA-Mind 552357b
Merge branch 'main' into pr/4863
M3gA-Mind f6b0b80
fix(memory): address ingestion review feedback
senamakel 5f20d8b
test(memory): align raw coverage with tinycortex
senamakel d4f05f5
test(composio): isolate provider mock backend
senamakel 5331e32
fix(memory): bound coding session ingestion batches
senamakel b871d09
test(tool-registry): serialize denial buffer cases
senamakel 29b1de8
fix(agent): reject tool calls in wrap-up replies
senamakel 85514fb
fix(agent): parse textual wrap-up tool calls
senamakel 9af3c22
test(memory): tolerate transient queue gate contention
senamakel 2f88c98
test(memory): align raw fixtures with tinycortex contracts
senamakel 0ee940e
test(composio): isolate direct mode config reload
senamakel f8364be
fix(memory): address session ingestion review gaps
senamakel 0131ec2
test(agent): align buffered wrap-up coverage contract
senamakel 6f233fd
ci(release): initialize nested CLI submodules
senamakel 66e3569
test(flows): isolate schema catalog fixtures
senamakel 6b82ce6
test(e2e): register coding session memory flow
senamakel 0f02c2e
fix(memory): bound coding session status reads
senamakel bdf672e
Merge remote-tracking branch 'upstream/main' into feat/tinycortex-ses…
senamakel 2a02f3a
Merge remote-tracking branch 'upstream/main' into feat/tinycortex-ses…
senamakel 3afa56a
fix(memory): satisfy warning-free clippy
senamakel bdc8d73
fix(analytics): identify coding session import action
senamakel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| import { useCallback, useEffect, useMemo, useState } from 'react'; | ||
|
|
||
| import { useT } from '../../lib/i18n/I18nContext'; | ||
| import { | ||
| type CodingSessionSourceStatus, | ||
| getCodingSessionStatus, | ||
| ingestCodingSessions, | ||
| } from '../../services/memorySourcesService'; | ||
| import type { ToastNotification } from '../../types/intelligence'; | ||
| import Button from '../ui/Button'; | ||
|
|
||
| interface CodingSessionsCardProps { | ||
| onToast?: (toast: Omit<ToastNotification, 'id'>) => void; | ||
| } | ||
|
|
||
| const SOURCE_LABEL_KEYS: Record<CodingSessionSourceStatus['kind'], string> = { | ||
| claude_code: 'memorySources.codingSessions.claude', | ||
| codex: 'memorySources.codingSessions.codex', | ||
| }; | ||
|
|
||
| export function CodingSessionsCard({ onToast }: CodingSessionsCardProps) { | ||
| const { t } = useT(); | ||
| const [sources, setSources] = useState<CodingSessionSourceStatus[]>([]); | ||
| const [loading, setLoading] = useState(true); | ||
| const [ingesting, setIngesting] = useState(false); | ||
| const [error, setError] = useState<string | null>(null); | ||
|
|
||
| const load = useCallback(async () => { | ||
| console.debug('[coding-sessions] status: entry'); | ||
| setError(null); | ||
| try { | ||
| const next = await getCodingSessionStatus(); | ||
| setSources(next); | ||
| console.debug('[coding-sessions] status: exit sources=%d', next.length); | ||
| } catch (cause) { | ||
| console.error('[coding-sessions] status failed', cause); | ||
| setError(cause instanceof Error ? cause.message : String(cause)); | ||
| } finally { | ||
| setLoading(false); | ||
| } | ||
| }, []); | ||
|
|
||
| useEffect(() => { | ||
| void load(); | ||
| }, [load]); | ||
|
|
||
| const totals = useMemo( | ||
| () => ({ | ||
| files: sources.reduce((sum, source) => sum + source.session_files, 0), | ||
| evidence: sources.reduce((sum, source) => sum + source.evidence_units, 0), | ||
| }), | ||
| [sources] | ||
| ); | ||
| const hasImportableHistory = | ||
| totals.files > 0 || sources.some(source => source.scan_truncated === true); | ||
|
|
||
| const ingest = useCallback(async () => { | ||
| console.debug('[coding-sessions] ingest: entry'); | ||
| setIngesting(true); | ||
| setError(null); | ||
| try { | ||
| const result = await ingestCodingSessions(false); | ||
| console.debug( | ||
| '[coding-sessions] ingest: exit processed=%d failed=%d budget_hit=%s', | ||
| result.sessions_processed, | ||
| result.sessions_failed, | ||
| result.budget_hit | ||
| ); | ||
| const incomplete = result.sessions_failed > 0 || result.budget_hit; | ||
| onToast?.({ | ||
| type: incomplete ? 'warning' : 'success', | ||
| title: t('memorySources.codingSessions.complete'), | ||
| message: | ||
| result.sessions_failed > 0 | ||
| ? t('memorySources.codingSessions.partialFailure') | ||
| .replace('{failed}', String(result.sessions_failed)) | ||
| .replace('{processed}', String(result.sessions_processed)) | ||
| : result.budget_hit | ||
| ? t('memorySources.codingSessions.moreRemaining') | ||
| : t('memorySources.codingSessions.completeMessage') | ||
| .replace('{processed}', String(result.sessions_processed)) | ||
| .replace('{observations}', String(result.observations)), | ||
| }); | ||
| await load(); | ||
| } catch (cause) { | ||
| console.error('[coding-sessions] ingest failed', cause); | ||
| const message = cause instanceof Error ? cause.message : String(cause); | ||
| setError(message); | ||
| onToast?.({ type: 'error', title: t('memorySources.codingSessions.failed'), message }); | ||
| } finally { | ||
| setIngesting(false); | ||
| } | ||
| }, [load, onToast, t]); | ||
|
|
||
| return ( | ||
| <section | ||
| className="rounded-lg border border-line bg-surface p-4" | ||
| data-testid="coding-sessions-card"> | ||
| <div className="flex flex-wrap items-start justify-between gap-3"> | ||
| <div> | ||
| <h3 className="text-sm font-semibold text-content"> | ||
| {t('memorySources.codingSessions.title')} | ||
| </h3> | ||
| <p className="mt-1 text-xs text-content-secondary"> | ||
| {t('memorySources.codingSessions.description')} | ||
| </p> | ||
| </div> | ||
| <Button | ||
| analyticsId="brain-sources-coding-sessions-ingest" | ||
| size="sm" | ||
| onClick={() => void ingest()} | ||
| disabled={loading || ingesting || !hasImportableHistory} | ||
| data-testid="coding-sessions-ingest"> | ||
|
senamakel marked this conversation as resolved.
|
||
| {ingesting | ||
| ? t('memorySources.codingSessions.ingesting') | ||
| : t('memorySources.codingSessions.ingest')} | ||
| </Button> | ||
| </div> | ||
|
|
||
| <div className="mt-3 grid gap-2 sm:grid-cols-2"> | ||
| {sources.map(source => ( | ||
| <div | ||
| key={source.kind} | ||
| className="rounded-md border border-line-subtle bg-surface-secondary px-3 py-2" | ||
| data-testid={`coding-session-source-${source.kind}`}> | ||
| <div className="text-xs font-medium text-content"> | ||
| {t(SOURCE_LABEL_KEYS[source.kind])} | ||
| </div> | ||
| <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> | ||
| )} | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
|
||
| {loading && ( | ||
| <p className="mt-3 text-xs text-content-secondary"> | ||
| {t('memorySources.codingSessions.scanning')} | ||
| </p> | ||
| )} | ||
| {error && ( | ||
| <p className="mt-3 text-xs text-coral-600 dark:text-coral-400" role="alert"> | ||
| {error} | ||
| </p> | ||
| )} | ||
| </section> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.