feat(grunt): named session slugs (peer-id / cwd) + visible in sidebar#11
Merged
Conversation
… + '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).
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
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
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).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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-a3f9kgruntcode --project ~/Developer/Projects/medella-website→ slug =medella-website-x7p2ncrisp-meadowstyleWhat's in the diff
packages/core/src/util/slug.ts: newSlug.createNamed(base)helper (sanitizes + appends 5-char base62)packages/core/src/util/opencode-process.ts: newgetPeerID()getter (mirror ofsetPeerID())packages/opencode/src/session/session.ts: derive slug at session creationpackages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx: render slug + rebrand footerPaired with
hivemind-mcp #X — adds
hivemind_unannounceso the registry's wakeable flag tracks live TUI presence. Together these implement the 'only show sessions whose gruntcode TUI is alive' requirement.Tests
bun typecheckclean frompackages/opencode. No new unit tests; the behavior is observed end-to-end in the TUI.