mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-04 10:14:47 +08:00
Merge branch 'main' into fix/db-malformed-self-restart
This commit is contained in:
@@ -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
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user