The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
fix: ignore transient Codex titles when naming branches
dee114375d561a2
diff --git a/cli/src/lib/gitProject.spec.ts b/cli/src/lib/gitProject.spec.tsindex a382d3520..34d0b255f 100644--- a/cli/src/lib/gitProject.spec.ts+++ b/cli/src/lib/gitProject.spec.ts@@ -9,6 +9,7 @@ import { placeholderBranch, sessionBranchSlug, worktreeFolderName } from './agenimport { nameBranchAfterSession } from './branchNaming.js'import { prepareGitProject, readGitProject, validGitPath } from './gitProject.js'import { parseProjectFolder, prepareProjectFolder } from './projectFolder.js'+import { engineSessionTitle, namingTitle } from './sessionTitle.js'const exec = promisify(execFile)// Real Git, several worktrees a test: slower than the default 5s under a full, parallel run.@@ -142,6 +143,31 @@ describe('launch Git preparation', { timeout: 30_000 }, () => {expect(await current(pushed)).toBe('sunny-owl')})+ it('waits through Codex rename statuses before naming the worktree after its conversation', async () => {+ const path = await prepare('worktree', 'refs/heads/feature', repo, { branchName: 'quiet-owl', branchMode: 'placeholder' })+ const session = { engine: 'codex', sessionId: 'naming-test', codexHome: join(root, 'codex'), cwd: path }+ await writeFile(join(path, 'src', 'value'), 'work in progress')+ for (const status of ['Starting | quiet-owl', 'renaming... ⠹', 'renaming… ⠴']) {+ const title = namingTitle(engineSessionTitle(session, status), session)+ expect(await nameBranchAfterSession(path, title)).toBeNull()+ expect(await current(path)).toBe('quiet-owl')+ expect(await git('config', '--get', 'branch.quiet-owl.harness')).toBe('placeholder')+ }++ await mkdir(session.codexHome)+ await writeFile(join(session.codexHome, 'session_index.jsonl'), JSON.stringify({+ id: session.sessionId, thread_name: 'Discuss configurable harness agents',+ }) + '\n')+ const title = namingTitle(engineSessionTitle(session, 'renaming... ⠴'), session)+ expect(await nameBranchAfterSession(path, title)).toBe('discuss-configurable-harness-agents')+ expect(await current(path)).toBe('discuss-configurable-harness-agents')+ expect(await git('config', '--get', 'branch.discuss-configurable-harness-agents.harness')).toBe('created')+ expect(await git('rev-parse', 'discuss-configurable-harness-agents')).toBe(await git('rev-parse', 'feature'))+ expect(await readFile(join(path, 'src', 'value'), 'utf8')).toBe('work in progress')+ expect(await nameBranchAfterSession(path, 'A later conversation title')).toBeNull()+ expect(await current(path)).toBe('discuss-configurable-harness-agents')+ })+it('checks out an existing branch as it is in a new worktree, once', async () => {await git('branch', 'topic', 'main')const path = await prepare('worktree', 'refs/heads/topic', repo, { branchName: 'topic', branchMode: 'existing' })diff --git a/cli/src/lib/sessionTitle.spec.ts b/cli/src/lib/sessionTitle.spec.tsindex e1c4767de..37da4b2c4 100644--- a/cli/src/lib/sessionTitle.spec.ts+++ b/cli/src/lib/sessionTitle.spec.ts@@ -33,6 +33,29 @@ describe('namingTitle: the engine’s title, when it names the session', () => {expect(namingTitle('Working | harness-36', codex)).toBeNull()expect(namingTitle('codex | Ready', codex)).toBeNull()})++ it.each([+ 'renaming',+ 'renaming...',+ 'Renaming…',+ 'renaming... ⠹',+ 'renaming... ⠴',+ 'renaming… ⠦',+ 'renaming ⠋',+ 'Working... ⠹',+ '[ ! ] Action Required…',+ 'renaming... ⠹ | golden-koala',+ ])('ignores the temporary Codex status %s', (title) => {+ expect(namingTitle(title, { engine: 'codex', cwd: '/src/golden-koala' })).toBeNull()+ })++ it('keeps conversation titles about renaming and strips only the separate status', () => {+ const codex = { engine: 'codex', cwd: '/src/golden-koala' }+ expect(namingTitle('Renaming branches safely', codex)).toBe('Renaming branches safely')+ expect(namingTitle('Working with multiple machines', codex)).toBe('Working with multiple machines')+ expect(namingTitle('renaming... ⠹ | Improve multiple-machine experience | golden-koala', codex))+ .toBe('Improve multiple-machine experience')+ })})describe('cleanCodexTitle', () => {diff --git a/cli/src/lib/sessionTitle.ts b/cli/src/lib/sessionTitle.tsindex cece7484b..203af1bcd 100644--- a/cli/src/lib/sessionTitle.ts+++ b/cli/src/lib/sessionTitle.ts@@ -29,8 +29,9 @@ const ENGINE_TITLES: ReadonlySet<string> = new Set([/** OpenCode (and Kilo, its fork) put their short name in front: "OC | Greeting". */const OPENCODE_PREFIX = /^(?:oc|opencode|kilo)\s+\|\s+/i-/** Codex's run-state words (run_state_status_text) and its action-required banner. */-const CODEX_STATUS = /^(?:\[\s*[!.]\s*\]\s*)?(?:starting|ready|working|waiting|thinking|action required)$/i+/** Codex's status text, including the ellipsis and Braille spinner shown while naming a thread.+ * Accepting `renaming... ⠹` as a title permanently names the worktree branch `renaming`. */+const CODEX_STATUS = /^(?:\[\s*[!.]\s*\]\s*)?(?:starting|ready|working|waiting|thinking|renaming|action required)(?:\s*(?:\.{3}|…))?(?:\s*[\u2800-\u28ff])?$/i/*** A title that names the session, or null when it only names the engine, the folder or the default.