Merge branch 'main' into fix/db-malformed-self-restart

This commit is contained in:
gavrielc
2026-05-23 20:06:10 +03:00
committed by GitHub
3 changed files with 13 additions and 7 deletions
+5 -3
View File
@@ -38,13 +38,15 @@ describe('formatter', () => {
expect(prompt).toContain('Hello world');
});
it('should format multiple chat messages as XML block', () => {
it('should format multiple chat messages as distinct <message> blocks', () => {
insertMessage('m1', 'chat', { sender: 'John', text: 'Hello' });
insertMessage('m2', 'chat', { sender: 'Jane', text: 'Hi there' });
const messages = getPendingMessages();
const prompt = formatMessages(messages);
expect(prompt).toContain('<messages>');
expect(prompt).toContain('</messages>');
// The <messages> envelope was dropped in fe2e881b (#2556) so the SDK calls
// the API; each message is now its own self-contained <message> block.
expect(prompt).not.toContain('<messages>');
expect(prompt.match(/<message /g) ?? []).toHaveLength(2);
expect(prompt).toContain('sender="John"');
expect(prompt).toContain('sender="Jane"');
});
@@ -257,8 +257,12 @@ function transcriptRotateBytes(): number {
* non-positive value) disables the age check; size alone then governs.
*/
function transcriptRotateAgeMs(): number {
const days = Number(process.env.CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS);
return Number.isFinite(days) && days > 0 ? days * 86_400_000 : 14 * 86_400_000;
const raw = process.env.CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS;
if (raw === undefined || raw.trim() === '') return 14 * 86_400_000;
const days = Number(raw);
if (!Number.isFinite(days)) return 14 * 86_400_000;
// Explicit non-positive override disables the age check; size alone governs.
return days > 0 ? days * 86_400_000 : Infinity;
}
function claudeProjectsDir(): string {
@@ -411,7 +415,7 @@ export class ClaudeProvider implements AgentProvider {
effort: this.effort as any,
permissionMode: 'bypassPermissions',
allowDangerouslySkipPermissions: true,
settingSources: ['project', 'user'],
settingSources: ['project', 'user', 'local'],
mcpServers: this.mcpServers,
hooks: {
PreToolUse: [{ hooks: [preToolUseHook] }],
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "nanoclaw",
"version": "2.0.66",
"version": "2.0.68",
"description": "Personal Claude assistant. Lightweight, secure, customizable.",
"type": "module",
"packageManager": "pnpm@10.33.0",