Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,8 @@ function normalizeAdvisorModelString(value: string | null | undefined): string |
return trimmedValue;
}

function normalizeAdvisorMaxUsesPerTurn(value: number | null | undefined): number | null {
if (!Number.isInteger(value) || value == null || value <= 0) {
return null;
}

return value;
}

function normalizeAdvisorMaxOutputTokens(value: number | null | undefined): number | null {
/** Coerce a nullable number to a positive integer or null. */
function normalizePositiveIntOrNull(value: number | null | undefined): number | null {
if (!Number.isInteger(value) || value == null || value <= 0) {
return null;
}
Expand Down Expand Up @@ -198,10 +191,8 @@ export function AdvisorToolExperimentConfig() {
const normalizedModelString = normalizeAdvisorModelString(cfg.advisorModelString);
const normalizedThinkingLevel =
coerceThinkingLevel(cfg.advisorThinkingLevel) ?? THINKING_LEVEL_OFF;
const normalizedMaxUsesPerTurn = normalizeAdvisorMaxUsesPerTurn(cfg.advisorMaxUsesPerTurn);
const normalizedMaxOutputTokens = normalizeAdvisorMaxOutputTokens(
cfg.advisorMaxOutputTokens
);
const normalizedMaxUsesPerTurn = normalizePositiveIntOrNull(cfg.advisorMaxUsesPerTurn);
const normalizedMaxOutputTokens = normalizePositiveIntOrNull(cfg.advisorMaxOutputTokens);
// Match the backend starter cap when the setting is unset; only an explicit null is
// the user's Unlimited opt-in.
const nextMaxUsesMode: AdvisorMode =
Expand Down
10 changes: 0 additions & 10 deletions src/browser/utils/messages/liveBashOutputBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,3 @@ export function appendLiveBashOutputChunk(

return next;
}

export function toLiveBashOutputView(state: LiveBashOutputInternal): LiveBashOutputView {
return {
stdout: state.stdout,
stderr: state.stderr,
combined: state.combined,
truncated: state.truncated,
phase: state.phase,
};
}
Loading