Merge master into refactor/envoverrides-tmux-export

Resolved conflict in src/web/public/session-ui.js by keeping this
PR's buildEnvOverrides() helper — it already covers both
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS (this PR) and
CLAUDE_CODE_EFFORT_LEVEL (added in #73), so the master-side inline
block is fully replaced.

Also fixed test/session-manager.test.ts MockSession to add a
getEnvOverridesForPersist() stub — without it,
SessionManager.updateSessionState's new call breaks 19 tests with
"TypeError: session.getEnvOverridesForPersist is not a function".

Verified: typecheck, lint, format:check, build, and
test/{session-manager,session-state,tmux-manager,tmux-restart-recovery}.test.ts
all pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
arkon
2026-04-28 02:43:31 +02:00
co-authored by Claude Opus 4.7
8 changed files with 154 additions and 29 deletions
+7 -10
View File
@@ -77,6 +77,10 @@ vi.mock('../src/session.js', () => {
};
}
getEnvOverridesForPersist() {
return undefined;
}
getOutput() {
return 'mock output';
}
@@ -147,19 +151,14 @@ describe('SessionManager', () => {
it('should persist session to store', async () => {
const session = await manager.createSession('/tmp/test');
expect(mockState.store.setSession).toHaveBeenCalledWith(
session.id,
expect.any(Object)
);
expect(mockState.store.setSession).toHaveBeenCalledWith(session.id, expect.any(Object));
});
it('should throw when max sessions reached', async () => {
mockState.store.state.config.maxConcurrentSessions = 1;
await manager.createSession('/tmp/test1');
await expect(manager.createSession('/tmp/test2')).rejects.toThrow(
/Maximum concurrent sessions/
);
await expect(manager.createSession('/tmp/test2')).rejects.toThrow(/Maximum concurrent sessions/);
});
it('should forward session output events', async () => {
@@ -325,9 +324,7 @@ describe('SessionManager', () => {
describe('sendToSession', () => {
it('should throw for non-existent session', async () => {
await expect(manager.sendToSession('non-existent', 'test')).rejects.toThrow(
/Session non-existent not found/
);
await expect(manager.sendToSession('non-existent', 'test')).rejects.toThrow(/Session non-existent not found/);
});
it('should send input to session', async () => {