Repository navigation
Use Grok metadata in terminal context #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import React from 'react'; | ||
| import { renderToStaticMarkup } from 'react-dom/server'; | ||
| import { describe, expect, it, vi } from 'vitest'; | ||
|
|
||
| vi.mock('@lobehub/icons/es/Grok', () => ({ | ||
| default: ({ className }: { className?: string }) => <svg className={className} />, | ||
| })); | ||
|
|
||
| import { HeroTerminalMarquee } from '../../components/home/HeroTerminalMarquee'; | ||
|
|
||
| describe('HeroTerminalMarquee', () => { | ||
| it('uses Grok metadata for the Grok terminal context', () => { | ||
| const markup = renderToStaticMarkup(<HeroTerminalMarquee />); | ||
|
|
||
| expect(markup).toContain('grok/relay-docs ~/relay/docs'); | ||
| expect(markup).not.toContain('codex/relay-docs ~/relay/docs'); | ||
| }); | ||
|
|
||
| it('renders enough repeated sequences to keep wide marquee rows covered', () => { | ||
| const markup = renderToStaticMarkup(<HeroTerminalMarquee />); | ||
|
|
||
| expect(markup.match(/grok\/relay-docs ~\/relay\/docs/g)).toHaveLength(4); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The test name claims it verifies the marquee keeps wide rows covered, but the assertion only counts occurrences of the literal Prompt for AI agents |
||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: This test only guards the branch-prefix half of the fix; the mode-from-metadata half is untested. The Grok context pane renders the mode from AGENT_META (
<span>{meta.mode}</span>), and the PR's stated fix is that this mode comes from the agent metadata instead of a hardcoded auto label, but the test never asserts it. Add an assertion that the rendered markup contains the metadata-driven mode (e.g.expect(markup).toContain('auto')scoped to the Grok context) so a regression in the mode no longer slips through.Prompt for AI agents