8000 Index Codex-runtime agent histories into the-brain (reviewer-b + Codex subagent work invisible to recall) · Issue #43 · simon-inkie/inkie-the-brain · GitHub
[go: up one dir, main page]

Skip to content

Index Codex-runtime agent histories into the-brain (reviewer-b + Codex subagent work invisible to recall) #43

Open

Description

@simon-inkie

Original Linear description

Problem

The-brain message indexer (core/indexer/messages.ts) ingests only two source types: OpenClaw gateway sessions (config.sources.messages) and Claude Code transcripts (discoverCCSessions, source prefix cc:). It has no Codex adapter. reviewer-b runs on the Codex runtime (~/agents/folio/.runtime = codex), storing history in ~/.codex/sessions/, so reviewer-b's entire history is unindexed and invisible to brain recall.

Impact (real, observed 2026-07-21)

A "lot of research" on a project decision was produced via a reviewer-a/reviewer-b (Codex) subagent and never surfaced in recall - the decision was effectively lost, and only recovered when the maintainer remembered it by hand. Any decision/research done on Codex agents vanishes from institutional memory.

Fix direction

Add a Codex-history adapter to the indexer (sibling to discoverCCSessions): discover ~/.codex/sessions/** rollout files, map to agent, normalise to the same message-pair shape, index with a codex: source prefix. The package already anticipates multiple adapters ("Claude Code adapter later" note).

Also check

Whether Claude subagent transcripts (the subagents/ subfolder) are indexed - a subagent-only result returned into a parent thread may or may not be captured. Confirm and close that gap too if open.

Relates to INK-644 (brain discoverability).

Update 2026-09-13 (maintainer)

Re-checked with the maintainer while the fleet's first wave (agent-c, agent-b, agent-f, agent-i) moves to Codex on Monday 14 Sept, so this now scales.

  • Inbox threads are already indexed for Codex agents (core/indexer/inbox.ts reads every ~/.the-brain/agents/<agent>/inbox/*.md, runtime-agnostic, watcher-driven). That was the maintainer's priority and needs nothing.
  • Raw transcripts: ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, 63 files on disk today, readable. Still no adapter in core/indexer/messages.ts. Fix direction above stands; agent mapping can use the AGENT_NAME set via shell_environment_policy in each agent's .codex/config.toml, or the rollout's cwd.
  • New, separate finding: Codex agents' .codex/hooks.json already wires Stop to the-brain's on-stop.sh (same as Claude agents), but agent-j and reviewer-b have zero files under memory/observations/. The observer hook fires and produces nothing on Codex, probably because it expects a Claude Code transcript path in the hook payload. That is a bug to reproduce by hand (run on-stop.sh with a Codex Stop payload) and either fix or split into its own ticket.

Agent-tooling code freeze applies: SPEC and hand over, do not build, until the OSS version. Lane: platform maintainer, after the Azure cutover prep.

Origin

Migrated from Linear: INK-704. The original wording is retained except the disclosed privacy and rendering edits below.

Current scope and qualifications

The description above is the original Linear account, including its historical findings and scope. It is not a fresh claim that every described defect still exists.
Current Linear state is Backlog. Prior source review recorded uncertain, with this remaining scope:

  • Locate and assess accepted investigation, SPEC and handover for raw Codex discovery/agent mapping and Claude subagent coverage.
  • Keep downstream implementation conditional on the applicable freeze/cutover decision. Track write-side observation separately under INK-773.

Publication transfers the task; it does not authorise live recovery, deployment, spending or configuration changes.

Transfer edits

  • Historical principal names are aliased in prose; artificial shell-filename web links are rendered as code where present.
  • Historical fleet identities are aliased; code identifiers and permitted source paths remain references.
  • Linear rich issue embeds are rendered as clickable Markdown links.
  • Public punctuation is normalised.
  • Additional transfer edits: generalise unrelated private app example; fleet prose aliases.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmajor-featureA substantial feature or new capability

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0