Skip to content

Gate terminal chunk debug logs#7

Merged
zebbern merged 1 commit into
mainfrom
codex/quiet-terminal-debug-logs
Jun 20, 2026
Merged

Gate terminal chunk debug logs#7
zebbern merged 1 commit into
mainfrom
codex/quiet-terminal-debug-logs

Conversation

@zebbern

@zebbern zebbern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • stop terminal chunk emission from writing console.debug by default
  • keep diagnostic chunk logging available behind SENTRIS_DEBUG_TERMINAL=1
  • add tests for default quiet behavior and explicit debug logging

Verification

  • bun test packages/component-sdk/src/tests/terminal-chunk.test.ts
  • bun test packages/component-sdk
  • bun run typecheck
  • bun run lint
  • bun run test
  • git push pre-push hook reran typecheck and tests successfully

Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noise from terminal chunk emission in @sentris/component-sdk by disabling chunk console.debug output by default, while still allowing targeted diagnostics via an environment flag, and adds tests to cover the new behavior.

Changes:

  • Gate terminal chunk debug logging behind SENTRIS_DEBUG_TERMINAL=1.
  • Add unit tests asserting the default “quiet” behavior and the explicit debug-enabled behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/component-sdk/src/terminal.ts Wraps terminal chunk console.debug behind an env-flag check.
packages/component-sdk/src/__tests__/terminal-chunk.test.ts Adds coverage for default no-debug behavior and debug-enabled logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to +7
function shouldDebugTerminalChunks(): boolean {
return process.env.SENTRIS_DEBUG_TERMINAL === '1';
}
Comment on lines +53 to +71
it('does not write debug logs by default', () => {
const debugSpy = vi.spyOn(console, 'debug').mockImplementation(() => {});

try {
const collector = vi.fn();
const context = createExecutionContext({
runId: 'run-1',
componentRef: 'node.a',
terminalCollector: collector,
});

const emitter = createTerminalChunkEmitter(context, 'stdout');
emitter('data');

expect(debugSpy).not.toHaveBeenCalled();
} finally {
debugSpy.mockRestore();
}
});
@zebbern zebbern merged commit 4fc2cd4 into main Jun 20, 2026
6 checks passed
@zebbern zebbern deleted the codex/quiet-terminal-debug-logs branch June 20, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants