Skip to content

Commit ea9b15a

Browse files
committed
fix: address remaining PR #88 review comments
AI-Agent: Codex/0.92.0 AI-Model: gpt-5.3-codex AI-Gotcha: address remaining PR #88 review comments AI-Confidence: medium AI-Tags: commands, tests, unit, infrastructure, services AI-Lifecycle: project AI-Memory-Id: 3e255327 AI-Source: heuristic
1 parent 45c8607 commit ea9b15a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/commands/hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export async function hookCommand(eventName: string, _logger?: ILogger): Promise
161161
return;
162162
}
163163

164-
const container = createContainer({ scope: `hook:${eventName}`, llm: config.llm });
164+
const container = createContainer({ scope: `hook:${eventName}`, llm: config.llm, cwd });
165165
const { eventBus } = container.cradle;
166166

167167
const event = buildEvent(eventType, normalizedInput);

tests/unit/infrastructure/services/RuntimeService.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ describe('RuntimeService', () => {
9292

9393
it('should handle write errors gracefully (never throw)', () => {
9494
try {
95-
// Try to write to an invalid path (root or protected directory)
96-
// This should not throw
95+
// Force write path failure deterministically by using a file as cwd.
96+
const invalidCwd = join(testDir, 'not-a-dir');
97+
writeFileSync(invalidCwd, 'x', 'utf8');
9798
const data = createRuntimeData();
98-
service.activate(data, '/nonexistent/path/that/should/not/exist');
99+
service.activate(data, invalidCwd);
100+
99101
// If we get here without throwing, the test passes
100102
assert.ok(true, 'activate should not throw on write errors');
101103
} finally {

0 commit comments

Comments
 (0)