Skip to content

feat(grunt): named session slugs (peer-id / cwd) + visible in sidebar#11

Merged
terrxo merged 1 commit into
devfrom
grunt-feat/named-slugs-and-sidebar
May 26, 2026
Merged

feat(grunt): named session slugs (peer-id / cwd) + visible in sidebar#11
terrxo merged 1 commit into
devfrom
grunt-feat/named-slugs-and-sidebar

Conversation

@terrxo

@terrxo terrxo commented May 26, 2026

Copy link
Copy Markdown

Session slug is now derived from launch context (peer-id, or cwd-basename when no peer-id is set) instead of a random adjective-noun pair. Slug is rendered in the session sidebar under the title so Nik can tell parallel tabs apart at a glance.

Also rebrands the sidebar footer 'Open Code' → 'grunt' (green) + 'code' (default text) to match the GRUNTCODE splash.

Behavior

  • gruntcode --peer-id nik-test --project /tmp → slug = nik-test-a3f9k
  • gruntcode --project ~/Developer/Projects/medella-website → slug = medella-website-x7p2n
  • Subagent sessions without peer-id or directory → fall back to the original crisp-meadow style

What's in the diff

  • packages/core/src/util/slug.ts: new Slug.createNamed(base) helper (sanitizes + appends 5-char base62)
  • packages/core/src/util/opencode-process.ts: new getPeerID() getter (mirror of setPeerID())
  • packages/opencode/src/session/session.ts: derive slug at session creation
  • packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx: render slug + rebrand footer

Paired with

hivemind-mcp #X — adds hivemind_unannounce so the registry's wakeable flag tracks live TUI presence. Together these implement the 'only show sessions whose gruntcode TUI is alive' requirement.

Tests

bun typecheck clean from packages/opencode. No new unit tests; the behavior is observed end-to-end in the TUI.

… + 'gruntcode' branding

The session slug is now derived from the launch context instead of a random
adjective-noun pair:

- If --peer-id (or OPENCODE_PEER_ID env) is set, slug = '<peer-id>-<5-char-hash>'
  (e.g. 'nik-test-a3f9k')
- Otherwise slug = '<cwd-basename>-<5-char-hash>'
  (e.g. 'gruntcode-x7p2n')
- Fallback to the random 'crisp-meadow' style only when neither is available

The slug is now rendered in the session sidebar under the title so Nik can tell
parallel tabs apart at a glance (and in screenshots) — previously the only
visible identifier was 'opencode <version>' in the footer.

Also rebrands the footer 'Open Code' -> 'grunt' (green) + 'code' (default text)
to match the GRUNTCODE splash.

New core API:
- Slug.createNamed(base: string): produces '<sanitized-base>-<5-char-hex>'
- getPeerID(): explicit getter to mirror setPeerID()

Sites changed:
- packages/core/src/util/slug.ts: new createNamed helper
- packages/core/src/util/opencode-process.ts: new getPeerID() getter
- packages/opencode/src/session/session.ts: derive slug from peer-id / cwd
- packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx: render slug + rebrand footer

Refs hivemind anomalyco#224 (sessions need visible names + must only show as wake
targets while their TUI is alive).
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@terrxo terrxo merged commit 18407fd into dev May 26, 2026
3 of 10 checks passed
@terrxo terrxo deleted the grunt-feat/named-slugs-and-sidebar branch May 26, 2026 23:47
terrxo added a commit that referenced this pull request May 28, 2026
… + 'gruntcode' branding (#11)

The session slug is now derived from the launch context instead of a random
adjective-noun pair:

- If --peer-id (or OPENCODE_PEER_ID env) is set, slug = '<peer-id>-<5-char-hash>'
  (e.g. 'nik-test-a3f9k')
- Otherwise slug = '<cwd-basename>-<5-char-hash>'
  (e.g. 'gruntcode-x7p2n')
- Fallback to the random 'crisp-meadow' style only when neither is available

The slug is now rendered in the session sidebar under the title so Nik can tell
parallel tabs apart at a glance (and in screenshots) — previously the only
visible identifier was 'opencode <version>' in the footer.

Also rebrands the footer 'Open Code' -> 'grunt' (green) + 'code' (default text)
to match the GRUNTCODE splash.

New core API:
- Slug.createNamed(base: string): produces '<sanitized-base>-<5-char-hex>'
- getPeerID(): explicit getter to mirror setPeerID()

Sites changed:
- packages/core/src/util/slug.ts: new createNamed helper
- packages/core/src/util/opencode-process.ts: new getPeerID() getter
- packages/opencode/src/session/session.ts: derive slug from peer-id / cwd
- packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx: render slug + rebrand footer

Refs hivemind anomalyco#224 (sessions need visible names + must only show as wake
targets while their TUI is alive).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant