fix: revert unauthorized $CMEM branding in context header
A prior Claude instance snuck in a `$CMEM` token branding header
during a context compression refactor (7e072106). Reverts back to
the original descriptive format: `# [project] recent context, datetime`
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ function formatHeaderDateTime(): string {
|
||||
*/
|
||||
export function renderAgentHeader(project: string): string[] {
|
||||
return [
|
||||
`# $CMEM ${project} ${formatHeaderDateTime()}`,
|
||||
`# [${project}] recent context, ${formatHeaderDateTime()}`,
|
||||
''
|
||||
];
|
||||
}
|
||||
@@ -223,5 +223,5 @@ export function renderAgentFooter(totalDiscoveryTokens: number, totalReadTokens:
|
||||
* Render agent empty state
|
||||
*/
|
||||
export function renderAgentEmptyState(project: string): string {
|
||||
return `# $CMEM ${project} ${formatHeaderDateTime()}\n\nNo previous sessions found.`;
|
||||
return `# [${project}] recent context, ${formatHeaderDateTime()}\n\nNo previous sessions found.`;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ describe('AgentFormatter', () => {
|
||||
const result = renderAgentHeader('my-project');
|
||||
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0]).toMatch(/^# \$CMEM my-project \d{4}-\d{2}-\d{2} \d{1,2}:\d{2}[ap]m [A-Z]{3,4}$/);
|
||||
expect(result[0]).toMatch(/^# \[my-project\] recent context, \d{4}-\d{2}-\d{2} \d{1,2}:\d{2}[ap]m [A-Z]{3,4}$/);
|
||||
expect(result[1]).toBe('');
|
||||
});
|
||||
|
||||
@@ -116,7 +116,7 @@ describe('AgentFormatter', () => {
|
||||
it('should handle empty project name', () => {
|
||||
const result = renderAgentHeader('');
|
||||
|
||||
expect(result[0]).toMatch(/^# \$CMEM \d{4}-\d{2}-\d{2} \d{1,2}:\d{2}[ap]m [A-Z]{3,4}$/);
|
||||
expect(result[0]).toMatch(/^# \[\] recent context, \d{4}-\d{2}-\d{2} \d{1,2}:\d{2}[ap]m [A-Z]{3,4}$/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -452,7 +452,7 @@ describe('AgentFormatter', () => {
|
||||
it('should return helpful message with project name', () => {
|
||||
const result = renderAgentEmptyState('my-project');
|
||||
|
||||
expect(result).toContain('# $CMEM my-project');
|
||||
expect(result).toContain('# [my-project] recent context,');
|
||||
expect(result).toContain('No previous sessions found.');
|
||||
});
|
||||
|
||||
@@ -466,7 +466,7 @@ describe('AgentFormatter', () => {
|
||||
it('should handle empty project name', () => {
|
||||
const result = renderAgentEmptyState('');
|
||||
|
||||
expect(result).toContain('# $CMEM ');
|
||||
expect(result).toContain('# [] recent context,');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user