Skip to content

fix(codex): expose hive sessions to usage scanners - #225

Closed
jhinzzz wants to merge 2 commits into
HarnessMD:mainfrom
jhinzzz:fix/codex-usage-discovery
Closed

jhinzzz wants to merge 2 commits into
HarnessMD:mainfrom
jhinzzz:fix/codex-usage-discovery

Conversation

@jhinzzz

@jhinzzz jhinzzz commented Aug 21, 2026 •

Copy link
Copy Markdown

What & why

Munder keeps each Codex worker in an isolated CODEX_HOME, while usage scanners normally read only the standard user-level .codex/sessions and .codex/archived_sessions roots. As a result, valid worker rollouts were invisible to external usage reports.

This change:

  • stores only rollout data in a namespaced munder-difflin/<hive>/<agent> directory under the standard Codex scan roots
  • links those directories back into each isolated CODEX_HOME, preserving existing resume and ownership paths
  • migrates existing active and archived workers during hive bootstrap
  • falls back to copy-then-remove across filesystems and rolls back if link creation fails
  • repairs dangling links on the next spawn
  • removes only validated Munder rollout targets during a full reset

Rollout files are neither transformed nor duplicated.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Docs
  • Build / CI

Screenshots / clips

Before

Before: usage scanner reports no sessions or tokens

After

After: usage scanner discovers sessions and token totals

Discord (optional)

Discord:

Checklist

  • npm run typecheck passes (the de-facto CI gate).
  • npm run build succeeds.
  • Any new UI derives from DESIGN.md / tokens.ts — no UI changes.
  • If I added art, it is my own or compatibly licensed, and listed in ATTRIBUTION.md — no art added.
  • PR is focused on a single change.

Verification

  • npm run test:focused: 244 passed, 0 failed
  • Existing and archived rollout migration, idempotency, dangling-link recovery, reset isolation, and path traversal are covered by regression tests
  • Tokscale 4.13.0 discovered a real migrated Codex rollout through the standard scan root and reported its token totals

@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

🚫 This PR is missing its before/after evidence

You attached something, but not one under each heading. Both are required, and they have to sit under their own heading so a reviewer can tell which is which.

  • Before — no image or video under that heading
  • After — no image or video under that heading

How to fix it: edit the description, keep the ### Before and ### After headings from the template, and drag an image or video under each. GitHub uploads it inline. This check re-runs the moment you save.

A bug fix with no visible surface still needs it: show the failing behaviour, then the same steps passing. A terminal recording is fine.

Genuinely nothing to show — a CI tweak, a typo, a dependency bump? A maintainer can apply the no-visual-change label. Please don't ask unless it truly has no observable effect.

📖 CONTRIBUTING.md → Evidence is mandatory

@jhinzzz

jhinzzz commented Aug 23, 2026

Copy link
Copy Markdown
Author

@chaitanyagiri The requested evidence is now attached under ### Before and ### After, but the required check still reports both sections as missing.

I reproduced the workflow parser against the current PR body. In section(), the regex combines the m flag with the lazy capture terminator |$. Under multiline mode, $ matches the blank line immediately after each heading, so both captured sections are empty.

A minimal fix is to replace that alternative with a true end-of-string check, for example (?![\\s\\S]), and rerun the workflow.

Failed run: https://github.com/chaitanyagiri/munder-difflin/actions/runs/32628110810

chaitanyagiri added a commit that referenced this pull request Aug 27, 2026
…ward or 4)

RELEASE.md contradicted itself: line 16 said "four merged pull requests" (only
tonight's four integration merges), the Thanks said "23 community pull requests
landed in this release" (the 0.4.5 number copied forward), and the historical
tail correctly says those 23 landed in v0.4.5.

Recounted from the actual 0.4.6 changeset (main b9f34e7..release tip, linear so
it is exactly this release). Method: a community PR is one authored by someone
other than the founder (@chaitanyagiri) whose work landed here, whether merged
or re-implemented. That gives 16 community PRs from 13 contributors:
#156 #205 #213 #225 #242 #243 #248 #270 #271 #282 #284 #286 #310 #317 #323 #339.
Fifteen landed as merges; #213 (Arabic) landed by re-implementation, which is why
a merge-only count returns 15 and misses it.

Line 16 and the Thanks now both say 16, the Thanks names all 13 contributors
inline so the credit matches the count, and the 0.4.5 sections (its intro and its
historical table) are left at 23 untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LDbmAwrgtGskFGCRkYZBx4
@chaitanyagiri

Copy link
Copy Markdown
Collaborator

Shipped in v0.4.6.

Your commit 5196c79a is in the release: hive sessions are exposed to usage scanners, with the coverage you added in test/hive-hook-node.test.cjs.

This closes rather than shows as merged because the commit went in through the 0.4.6 release branch instead of this PR's branch.

https://github.com/chaitanyagiri/munder-difflin/releases/tag/v0.4.6

Apologies for the delay in closing it. Thank you.

pull Bot pushed a commit to codingwatching/munder-difflin that referenced this pull request Aug 27, 2026
@jhinzzz

jhinzzz commented Aug 31, 2026

Copy link
Copy Markdown
Author

Hi, @chaitanyagiri ,
Thank you for your explanation and for adopting my changes. I understand that the commit was merged through the release branch. To make this contribution more visible in the project record and to encourage my future participation, would you be open to adding my GitHub handle (@jhinzzz ) to the contributor list (e.g., in README.md or CONTRIBUTORS.md)? I'd really appreciate it. Thanks again!

@chaitanyagiri

Copy link
Copy Markdown
Collaborator

Hey, @jhinzzz thanks for your contribution, apologies for not marking it as merged, I've added a discussion thread explaining the issue. I've added the credits for this one in the release notes.

Your contributions are very valuable to us, please rest assured that next PRs will be marked as merged or handles will be tagged for contributions in readme or a dedicated contributors markdown file.

Best,
Chaitanya from Munder Difflin

@chaitanyagiri

Copy link
Copy Markdown
Collaborator

#353

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants