Skip to content

Commit 9dc9efa

Browse files
authored
Merge branch 'main' into fix/db-malformed-self-restart
2 parents 3df3047 + 8f332e0 commit 9dc9efa

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

container/agent-runner/src/poll-loop.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ describe('formatter', () => {
3838
expect(prompt).toContain('Hello world');
3939
});
4040

41-
it('should format multiple chat messages as XML block', () => {
41+
it('should format multiple chat messages as distinct <message> blocks', () => {
4242
insertMessage('m1', 'chat', { sender: 'John', text: 'Hello' });
4343
insertMessage('m2', 'chat', { sender: 'Jane', text: 'Hi there' });
4444
const messages = getPendingMessages();
4545
const prompt = formatMessages(messages);
46-
expect(prompt).toContain('<messages>');
47-
expect(prompt).toContain('</messages>');
46+
// The <messages> envelope was dropped in fe2e881b (#2556) so the SDK calls
47+
// the API; each message is now its own self-contained <message> block.
48+
expect(prompt).not.toContain('<messages>');
49+
expect(prompt.match(/<message /g) ?? []).toHaveLength(2);
4850
expect(prompt).toContain('sender="John"');
4951
expect(prompt).toContain('sender="Jane"');
5052
});

container/agent-runner/src/providers/claude.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,12 @@ function transcriptRotateBytes(): number {
257257
* non-positive value) disables the age check; size alone then governs.
258258
*/
259259
function transcriptRotateAgeMs(): number {
260-
const days = Number(process.env.CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS);
261-
return Number.isFinite(days) && days > 0 ? days * 86_400_000 : 14 * 86_400_000;
260+
const raw = process.env.CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS;
261+
if (raw === undefined || raw.trim() === '') return 14 * 86_400_000;
262+
const days = Number(raw);
263+
if (!Number.isFinite(days)) return 14 * 86_400_000;
264+
// Explicit non-positive override disables the age check; size alone governs.
265+
return days > 0 ? days * 86_400_000 : Infinity;
262266
}
263267

264268
function claudeProjectsDir(): string {
@@ -411,7 +415,7 @@ export class ClaudeProvider implements AgentProvider {
411415
effort: this.effort as any,
412416
permissionMode: 'bypassPermissions',
413417
allowDangerouslySkipPermissions: true,
414-
settingSources: ['project', 'user'],
418+
settingSources: ['project', 'user', 'local'],
415419
mcpServers: this.mcpServers,
416420
hooks: {
417421
PreToolUse: [{ hooks: [preToolUseHook] }],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nanoclaw",
3-
"version": "2.0.66",
3+
"version": "2.0.68",
44
"description": "Personal Claude assistant. Lightweight, secure, customizable.",
55
"type": "module",
66
"packageManager": "pnpm@10.33.0",

0 commit comments

Comments
 (0)