Conversation
…mprovements Replace per-model 1M context selection with a single global "Extended Context (1M)" toggle. When enabled, all models (main session, commands, and sub-agents) get the [1m] suffix applied at injection time. Settings UI redesigned: unified single-table layout with fixed column widths for consistent vertical alignment, compact toggle card, reduced spacing. Legacy [1m] values in existing configs are stripped silently without auto-enabling extended context — users must opt in explicitly. Also includes hook improvements: refactored checkers, new test coverage for context monitor, spec validators, and tool redirect.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughConsolidates model selection to base variants ( Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @maxritter's task in 2m 28s —— View job Code Review
|
| Correctness | Mostly good. The [1m]/extendedContext contract between settings and Python hooks needs clarification (issue #1). |
| Tests | Well-covered for hooks and routes. useSettings hook tests are thin. |
| UI | Clean redesign, compact toggle layout works well. |
| Code quality | Hook refactoring improves testability and composability. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
console/src/ui/viewer/hooks/useSettings.ts (1)
105-120: Mixedawait+.then()style insave.The function uses
await fetch(...).then(...).then(...). This works but is inconsistent — either pureasync/awaitor pure promise chaining would be clearer. The same applies to thefetchinuseEffect(line 60–72) which uses pure.then().Optional: pure async/await version
const save = useCallback(async () => { - await fetch("/api/settings", { + const r = await fetch("/api/settings", { method: "PUT", headers: { "Content-Type": "application/json" }, body: JSON.stringify(settings), - }) - .then((r) => { - if (!r.ok) throw new Error(`Save failed: ${r.status}`); - return r.json(); - }) - .then((data: ModelSettings) => { - setSettings(data); - setIsDirty(false); - setSaved(true); - }); + }); + if (!r.ok) throw new Error(`Save failed: ${r.status}`); + const data: ModelSettings = await r.json(); + setSettings(data); + setIsDirty(false); + setSaved(true); }, [settings]);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@console/src/ui/viewer/hooks/useSettings.ts` around lines 105 - 120, In useSettings (hook) refactor the mixed await + .then() in the save function to a consistent async/await style: inside save() await fetch("/api/settings", { method: "PUT", headers: {...}, body: JSON.stringify(settings) }), check response.ok and throw with status if not ok, then await response.json() to get ModelSettings and call setSettings(data), setIsDirty(false), setSaved(true); also apply the same consistency to the earlier fetch in the useEffect (line ~60–72) by converting its promise chain to async/await and adding proper try/catch error handling to surface failures (use the existing state setters or error logging as appropriate).console/src/services/worker/http/routes/SettingsRoutes.ts (2)
17-44:MODEL_CHOICESandDEFAULT_SETTINGSare duplicated across server and client.Identical definitions exist in both
SettingsRoutes.ts(lines 17, 26–44) anduseSettings.ts(lines 3, 19–37). A single shared source of truth would prevent drift.Not blocking for this PR since both are kept in sync and covered by tests, but worth tracking.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@console/src/services/worker/http/routes/SettingsRoutes.ts` around lines 17 - 44, MODEL_CHOICES, ModelSettings and DEFAULT_SETTINGS are duplicated between SettingsRoutes and useSettings; extract them into a single shared module (e.g., settings/constants or a shared types module) and import that module from both SettingsRoutes and useSettings to ensure one source of truth; update exports to export MODEL_CHOICES, ModelSettings and DEFAULT_SETTINGS and replace local definitions in the SettingsRoutes and useSettings files with imports, run tests to confirm no behavior change.
69-71:stripLegacy1monly handles lowercase[1m].
String.replacewith a literal won't match case variations like[1M]. This is probably fine if the system always stored lowercase, but worth a note.Slightly more robust alternative
private static stripLegacy1m(model: string): string { - return model.replace("[1m]", ""); + return model.replace(/\[1m\]/i, ""); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@console/src/services/worker/http/routes/SettingsRoutes.ts` around lines 69 - 71, stripLegacy1m currently only removes the exact lowercase substring "[1m]" which misses variants like "[1M]" or multiple occurrences; update the private static stripLegacy1m(model: string): string to remove all case variations and occurrences by using a case-insensitive, global match (e.g. use a regex with the i and g flags) on the model string and return the cleaned result so both "[1m]" and "[1M]" (and any duplicates) are stripped.console/src/ui/viewer/views/Settings/index.tsx (1)
273-273: Sticky save bar may overlap page content on smaller viewports.The
pb-16on the container (line 106) provides some padding, but the fixed bar height + padding could exceed that on edge cases. Consider matching the padding to the actual bar height or using a spacer element.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@console/src/ui/viewer/views/Settings/index.tsx` at line 273, The fixed sticky save bar div (className "fixed bottom-0 left-0 right-0 bg-base-100 border-t border-base-300 px-6 py-2 flex items-center gap-4 z-50") can overlap content because the parent container only uses a static "pb-16" padding; update the layout by making the bottom spacing dynamic to match the actual bar height instead of a hardcoded pb-16 — either (A) replace or augment the parent container's "pb-16" with a spacer whose height matches the bar (e.g., add a spacer element directly above the fixed bar with height equal to the bar's computed height or CSS variable), or (B) compute/set a CSS variable for the bar height and apply it to the parent padding-bottom so the container padding uses the exact same value as the fixed bar's height; locate the save bar by its className and the page wrapper with "pb-16" to implement the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.gitignore:
- Line 239: Replace the incorrect uppercase pattern ".DS_STORE" in .gitignore
with the correct macOS metadata filename ".DS_Store" so the ignore rule matches
on case-sensitive filesystems; locate the line containing ".DS_STORE" and update
it to ".DS_Store".
---
Nitpick comments:
In `@console/src/services/worker/http/routes/SettingsRoutes.ts`:
- Around line 17-44: MODEL_CHOICES, ModelSettings and DEFAULT_SETTINGS are
duplicated between SettingsRoutes and useSettings; extract them into a single
shared module (e.g., settings/constants or a shared types module) and import
that module from both SettingsRoutes and useSettings to ensure one source of
truth; update exports to export MODEL_CHOICES, ModelSettings and
DEFAULT_SETTINGS and replace local definitions in the SettingsRoutes and
useSettings files with imports, run tests to confirm no behavior change.
- Around line 69-71: stripLegacy1m currently only removes the exact lowercase
substring "[1m]" which misses variants like "[1M]" or multiple occurrences;
update the private static stripLegacy1m(model: string): string to remove all
case variations and occurrences by using a case-insensitive, global match (e.g.
use a regex with the i and g flags) on the model string and return the cleaned
result so both "[1m]" and "[1M]" (and any duplicates) are stripped.
In `@console/src/ui/viewer/hooks/useSettings.ts`:
- Around line 105-120: In useSettings (hook) refactor the mixed await + .then()
in the save function to a consistent async/await style: inside save() await
fetch("/api/settings", { method: "PUT", headers: {...}, body:
JSON.stringify(settings) }), check response.ok and throw with status if not ok,
then await response.json() to get ModelSettings and call setSettings(data),
setIsDirty(false), setSaved(true); also apply the same consistency to the
earlier fetch in the useEffect (line ~60–72) by converting its promise chain to
async/await and adding proper try/catch error handling to surface failures (use
the existing state setters or error logging as appropriate).
In `@console/src/ui/viewer/views/Settings/index.tsx`:
- Line 273: The fixed sticky save bar div (className "fixed bottom-0 left-0
right-0 bg-base-100 border-t border-base-300 px-6 py-2 flex items-center gap-4
z-50") can overlap content because the parent container only uses a static
"pb-16" padding; update the layout by making the bottom spacing dynamic to match
the actual bar height instead of a hardcoded pb-16 — either (A) replace or
augment the parent container's "pb-16" with a spacer whose height matches the
bar (e.g., add a spacer element directly above the fixed bar with height equal
to the bar's computed height or CSS variable), or (B) compute/set a CSS variable
for the bar height and apply it to the parent padding-bottom so the container
padding uses the exact same value as the fixed bar's height; locate the save bar
by its className and the page wrapper with "pb-16" to implement the change.
…st gates Update launcher tests to match current hook behavior: hooks return exit code 0 and communicate via JSON on stdout (stop_block, pre_tool_use_deny, additionalContext) instead of exit codes and stderr. Fix get_max_context_tokens to use extended_context flag instead of model string. Fix Dashboard test by adding Workspace comment label. Add pre-commit hook gates: Python unit tests run when launcher/pilot hooks change, Console unit tests + typecheck run when console source changes — catches failures before push.
|
Claude finished @maxritter's task in 50s —— View job Incremental Code Review
This push added changes to New issues in this push1. Pre-commit: Python tests run with
|
| Issue | Status |
|---|---|
#1 Python hooks [1m]/extendedContext contract undocumented |
Still open — _util.py unchanged in this push |
#2 stripLegacy1m should use suffix-anchored regex |
Still open — SettingsRoutes.ts unchanged |
#3 save() in useSettings.ts swallows errors silently |
Still open — useSettings.ts unchanged |
#4 Missing useSettings hook behavior tests |
Still open — test file unchanged |
#5 context_monitor.py None vs [] inconsistency |
Still open — context_monitor.py unchanged |
.DS_STORE casing (CodeRabbit) |
Still open — .gitignore unchanged |
stripLegacy1m case sensitivity (CodeRabbit) |
Still open |
Configs with model: "opus[1m]" (old format, no extendedContext key) were silently downgraded to 200K context because migration stripped [1m] without setting extendedContext=true. Now detects legacy [1m] in any model value and auto-enables extended context to preserve user intent.
|
Claude finished @maxritter's task in 1m 13s —— View job Incremental Code Review
This push modified New issues in this push1. PR description contradicts code: legacy
|
| Issue | Location |
|---|---|
stripLegacy1m should use suffix-anchored regex replace(/\[1m\]$/, "") |
SettingsRoutes.ts:70 |
Pre-commit pipefail missing — pytest | tail -5 silently passes on failure |
.githooks/pre-commit:8,15,33 |
Python hooks _util.py: [1m]/extendedContext contract undocumented |
pilot/hooks/_util.py |
save() in useSettings.ts swallows errors silently (no .catch()) |
useSettings.ts:105-119 |
Missing useSettings hook behavior tests |
useSettings.test.ts |
context_monitor.py None vs [] inconsistency in save_cache call |
context_monitor.py:184 |
.DS_STORE should be .DS_Store (case-sensitive filesystems) |
.gitignore:239 |
Sticky save bar pb-16 may not match actual bar height |
Settings/index.tsx:273 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.githooks/pre-commit (1)
48-48:npm run buildis inconsistent with thebun-based toolchain used in the rest of this hookGates 2 and 3 use
bun test/bun run typecheckbut the build step falls back tonpm run build. Consider aligning on one package-manager binary throughout.♻️ Proposed refactor
- if ! (cd console && npm run build 2>&1 | tail -3); then + if ! (cd console && bun run build 2>&1 | tail -3); then🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.githooks/pre-commit at line 48, The build gate in the pre-commit hook uses "npm run build" which is inconsistent with the bun-based commands used elsewhere; update the command "cd console && npm run build 2>&1 | tail -3" to use bun (e.g., "cd console && bun run build 2>&1 | tail -3" or "cd console && bun build 2>&1 | tail -3") so the hook consistently uses the bun toolchain, keeping the same subshell, output piping and exit status check intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.githooks/pre-commit:
- Line 8: The pre-commit hook uses "set -e" but not "set -o pipefail", so
pipelines that end in "tail" hide failures from earlier commands (pytest, bun
test, bun run typecheck, npm run build) and the "if !" guards never trigger; fix
by adding "set -o pipefail" immediately after the existing "set -e" at the top
of the script so any failing stage in a pipeline causes a non-zero exit and the
existing if ! checks will correctly detect failures.
- Line 28: Update the error message in the pre-commit hook so it instructs
developers to run the correct package manager used elsewhere in the hook:
replace the current echo that says "npm install" with one that says "bun
install" (refer to the existing echo line that prints "[pre-commit] ERROR:
console/node_modules missing. Run: cd console && npm install"). Ensure the
message matches the other console commands in the hook and clearly directs the
user to "cd console && bun install".
---
Nitpick comments:
In @.githooks/pre-commit:
- Line 48: The build gate in the pre-commit hook uses "npm run build" which is
inconsistent with the bun-based commands used elsewhere; update the command "cd
console && npm run build 2>&1 | tail -3" to use bun (e.g., "cd console && bun
run build 2>&1 | tail -3" or "cd console && bun build 2>&1 | tail -3") so the
hook consistently uses the bun toolchain, keeping the same subshell, output
piping and exit status check intact.
Add set -o pipefail so pipe failures propagate correctly — without it, tail always exits 0, masking test/typecheck failures. Simplify gate structure: with pipefail + set -e, failures auto-exit without if-wrappers. Fix .DS_STORE → .DS_Store (macOS uses mixed case). Fix npm → bun in error message for consistency.
|
Claude finished @maxritter's task in 1m 16s —— View job Incremental Code Review
This push modified ✅ Resolved from prior reviews
Still open: one remaining pre-commit issue
|
| Issue | Location |
|---|---|
stripLegacy1m should use suffix-anchored regex replace(/\[1m\]$/, "") |
SettingsRoutes.ts:70 |
Python hooks _util.py: [1m]/extendedContext contract undocumented |
pilot/hooks/_util.py |
save() in useSettings.ts no .catch() — errors propagate to callers |
useSettings.ts:105-119 |
Missing useSettings hook behavior tests |
useSettings.test.ts |
context_monitor.py None vs [] inconsistency in save_cache call |
context_monitor.py:184 |
hasLegacy1m not set for legacy [1m] in agents loop |
SettingsRoutes.ts:114-123 |
PR description says legacy [1m] is stripped without auto-enabling — code does the opposite |
SettingsRoutes.ts |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
console/tests/settings-routes.test.ts (1)
155-177: Good legacy migration coverage, but missing the agents caseTests for
opus[1m](model) andsonnet[1m](command) auto-enablingextendedContextare present and correct. However, there is no corresponding test for a config where only an agent value carries a[1m]suffix. Once the agents loop inSettingsRoutes.mergeWithDefaultsis fixed to updatehasLegacy1m(see comment on lines 109–124 ofSettingsRoutes.ts), a parallel test here will be needed:it('should auto-enable extendedContext when legacy 1m agents found', async () => { fs.writeFileSync(configPath, JSON.stringify({ model: 'opus', agents: { 'plan-challenger': 'sonnet[1m]' } })); const m = makeMockRes(); const req: Partial<Request> = {}; await (routes as any).handleGet(req as Request, m.res as Response); expect(m.body.agents['plan-challenger']).toBe('sonnet'); expect(m.body.extendedContext).toBe(true); });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@console/tests/settings-routes.test.ts` around lines 155 - 177, Add a test to cover the agents case where an agent value has a legacy "[1m]" suffix so extendedContext is auto-enabled: add a new it block in console/tests/settings-routes.test.ts that writes a config with model 'opus' and agents { 'plan-challenger': 'sonnet[1m]' }, calls routes.handleGet, and asserts that m.body.agents['plan-challenger'] has been normalized to 'sonnet' and m.body.extendedContext is true; this mirrors the existing model/commands tests and will validate the fix in SettingsRoutes.mergeWithDefaults (ensure the agents loop updates the hasLegacy1m flag).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.githooks/pre-commit:
- Line 11: The hook aborts due to SIGPIPE when using head -1 with set -eo
pipefail; remove the piping to head (i.e., change the assignment to
PYTHON_CHANGED to use the full output of git diff --cached --name-only --
'launcher/' 'pilot/hooks/' without | head -1) so the command always exits 0 and
PYTHON_CHANGED remains truthy when files are staged; update the analogous
CONSOLE_CHANGED/other occurrences that use | head -1 the same way to eliminate
the pipefail risk.
- Line 39: Replace the inconsistent npm invocation in the pre-commit hook: the
line using "(cd console && npm run build 2>&1) | tail -3" should use bun like
the other lines (e.g., "bun run build") so the hook consistently relies on bun;
update that command to "(cd console && bun run build 2>&1) | tail -3" to match
the existing use of "bun test" and "bun run typecheck".
In `@console/src/services/worker/http/routes/SettingsRoutes.ts`:
- Around line 109-124: In the agents-processing block inside SettingsRoutes,
detect legacy "[1m]" the same way as the commands loop: before calling
SettingsRoutes.stripLegacy1m on each agent value (the loop iterating over
rawAgents entries and assigning into mergedAgents), check if the original string
v includes "[1m]" and set hasLegacy1m = true when so; then continue to strip
with SettingsRoutes.stripLegacy1m and validate against MODEL_CHOICES as
currently implemented. Ensure you reference the existing variables/funcs
mergedAgents, hasLegacy1m, MODEL_CHOICES, SettingsRoutes.stripLegacy1m, and
rawAgents so the change is localized to that agents loop.
---
Nitpick comments:
In `@console/tests/settings-routes.test.ts`:
- Around line 155-177: Add a test to cover the agents case where an agent value
has a legacy "[1m]" suffix so extendedContext is auto-enabled: add a new it
block in console/tests/settings-routes.test.ts that writes a config with model
'opus' and agents { 'plan-challenger': 'sonnet[1m]' }, calls routes.handleGet,
and asserts that m.body.agents['plan-challenger'] has been normalized to
'sonnet' and m.body.extendedContext is true; this mirrors the existing
model/commands tests and will validate the fix in
SettingsRoutes.mergeWithDefaults (ensure the agents loop updates the hasLegacy1m
flag).
| exit 1 | ||
| fi | ||
| # --- 1. Python unit tests --- | ||
| PYTHON_CHANGED=$(git diff --cached --name-only -- 'launcher/' 'pilot/hooks/' | head -1) |
There was a problem hiding this comment.
set -eo pipefail + head -1 causes spurious hook abort when ≥2 files are staged
With pipefail in effect, code like somecmd | head -n1 will sometimes cause an error, depending on whether the output of somecmd exceeds the size of the pipe buffer or not. When two or more Python or console files are staged simultaneously, git diff gets SIGPIPE (exit 141) as soon as head -1 closes the pipe. Exit status 141 indicates the program was terminated by SIGPIPE (141 − 128 = 13). When running scripts with set -o pipefail, this terminates the script.
Net result: the hook aborts before any tests run whenever a multi-file commit touches launcher/, pilot/hooks/, or console/.
The head -1 was likely added as a performance short-circuit, but since git diff --cached --name-only is fast for a local index check, it's not necessary:
🐛 Proposed fix — remove head -1 to eliminate the SIGPIPE entirely
-PYTHON_CHANGED=$(git diff --cached --name-only -- 'launcher/' 'pilot/hooks/' | head -1)
+PYTHON_CHANGED=$(git diff --cached --name-only -- 'launcher/' 'pilot/hooks/')-CONSOLE_CHANGED=$(git diff --cached --name-only -- 'console/src/' 'console/scripts/' 'console/package.json' 'console/tsconfig.json' 'console/vite.config.ts' | head -1)
+CONSOLE_CHANGED=$(git diff --cached --name-only -- 'console/src/' 'console/scripts/' 'console/package.json' 'console/tsconfig.json' 'console/vite.config.ts')git diff --cached --name-only exits 0 in all cases; removing head -1 makes PYTHON_CHANGED/CONSOLE_CHANGED capture the full list of changed files (still non-empty ⟹ truthy), with no SIGPIPE risk.
Also applies to: 20-20
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.githooks/pre-commit at line 11, The hook aborts due to SIGPIPE when using
head -1 with set -eo pipefail; remove the piping to head (i.e., change the
assignment to PYTHON_CHANGED to use the full output of git diff --cached
--name-only -- 'launcher/' 'pilot/hooks/' without | head -1) so the command
always exits 0 and PYTHON_CHANGED remains truthy when files are staged; update
the analogous CONSOLE_CHANGED/other occurrences that use | head -1 the same way
to eliminate the pipefail risk.
| echo "[pre-commit] Console typecheck passed." | ||
|
|
||
| echo "[pre-commit] Rebuilding console artifacts..." | ||
| (cd console && npm run build 2>&1) | tail -3 |
There was a problem hiding this comment.
npm run build is inconsistent — the rest of the script uses bun
Lines 30 and 35 use bun test and bun run typecheck; line 39 reverts to npm run build. If developers have only bun installed (not npm), the build step will fail unexpectedly after the tests pass.
🛠️ Proposed fix
- (cd console && npm run build 2>&1) | tail -3
+ (cd console && bun run build 2>&1) | tail -3📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| (cd console && npm run build 2>&1) | tail -3 | |
| (cd console && bun run build 2>&1) | tail -3 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.githooks/pre-commit at line 39, Replace the inconsistent npm invocation in
the pre-commit hook: the line using "(cd console && npm run build 2>&1) | tail
-3" should use bun like the other lines (e.g., "bun run build") so the hook
consistently relies on bun; update that command to "(cd console && bun run build
2>&1) | tail -3" to match the existing use of "bun test" and "bun run
typecheck".
| if ( | ||
| rawAgents && | ||
| typeof rawAgents === "object" && | ||
| !Array.isArray(rawAgents) | ||
| ) { | ||
| for (const [k, v] of Object.entries( | ||
| rawAgents as Record<string, unknown>, | ||
| )) { | ||
| if (typeof v === "string") { | ||
| const stripped = SettingsRoutes.stripLegacy1m(v); | ||
| if (MODEL_CHOICES.includes(stripped)) { | ||
| mergedAgents[k] = stripped; | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Agents loop doesn't set hasLegacy1m — asymmetry with the commands loop
The commands loop (lines 94–104) correctly does if (v.includes("[1m]")) hasLegacy1m = true; before stripping. The agents loop strips and validates but never updates hasLegacy1m. A config that has only legacy [1m] agent values (but a clean main model and commands) will silently get extendedContext: false after migration, losing the 1M context the user previously had.
🐛 Proposed fix
for (const [k, v] of Object.entries(
rawAgents as Record<string, unknown>,
)) {
if (typeof v === "string") {
+ if (v.includes("[1m]")) hasLegacy1m = true;
const stripped = SettingsRoutes.stripLegacy1m(v);
if (MODEL_CHOICES.includes(stripped)) {
mergedAgents[k] = stripped;
}
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if ( | |
| rawAgents && | |
| typeof rawAgents === "object" && | |
| !Array.isArray(rawAgents) | |
| ) { | |
| for (const [k, v] of Object.entries( | |
| rawAgents as Record<string, unknown>, | |
| )) { | |
| if (typeof v === "string") { | |
| const stripped = SettingsRoutes.stripLegacy1m(v); | |
| if (MODEL_CHOICES.includes(stripped)) { | |
| mergedAgents[k] = stripped; | |
| } | |
| } | |
| } | |
| } | |
| if ( | |
| rawAgents && | |
| typeof rawAgents === "object" && | |
| !Array.isArray(rawAgents) | |
| ) { | |
| for (const [k, v] of Object.entries( | |
| rawAgents as Record<string, unknown>, | |
| )) { | |
| if (typeof v === "string") { | |
| if (v.includes("[1m]")) hasLegacy1m = true; | |
| const stripped = SettingsRoutes.stripLegacy1m(v); | |
| if (MODEL_CHOICES.includes(stripped)) { | |
| mergedAgents[k] = stripped; | |
| } | |
| } | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@console/src/services/worker/http/routes/SettingsRoutes.ts` around lines 109 -
124, In the agents-processing block inside SettingsRoutes, detect legacy "[1m]"
the same way as the commands loop: before calling SettingsRoutes.stripLegacy1m
on each agent value (the loop iterating over rawAgents entries and assigning
into mergedAgents), check if the original string v includes "[1m]" and set
hasLegacy1m = true when so; then continue to strip with
SettingsRoutes.stripLegacy1m and validate against MODEL_CHOICES as currently
implemented. Ensure you reference the existing variables/funcs mergedAgents,
hasLegacy1m, MODEL_CHOICES, SettingsRoutes.stripLegacy1m, and rawAgents so the
change is localized to that agents loop.
## [6.8.2](v6.8.1...v6.8.2) (2026-02-18) ### Bug Fixes * global extended context toggle, compact settings UI, and hook improvements ([#63](#63)) ([01a315c](01a315c))
|
🎉 This PR is included in version 6.8.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |

Summary
[1m]to all models simultaneously (main session, commands, and sub-agents)[1m]values in existing configs are silently stripped without auto-enabling extended context — users must opt in explicitly via the toggleTest plan
uv run pytest launcher/tests/unit/test_model_config.py launcher/tests/unit/test_settings_injector.py(49 pass)bun test tests/hooks/useSettings.test.ts tests/settings-routes.test.ts(33 pass)[1m]models migrates cleanly (stripped, toggle off)Summary by CodeRabbit
New Features
Improvements
Documentation
Tests
Chores