Skip to content

feat(tui): overview folding widget; agents.memory_effort sidecar config; runtime model rows - #1709

Open
alecuba16 wants to merge 1 commit into
1jehuang:masterfrom
alecuba16:fix/info_fields
Open

alecuba16 wants to merge 1 commit into
1jehuang:masterfrom
alecuba16:fix/info_fields

Conversation

@alecuba16

Copy link
Copy Markdown
Contributor

Closes #1639. Closes #1634.

Three related info-panel changes in one commit:

agents.memory_effort (env JCODE_MEMORY_EFFORT) pins the reasoning effort of the memory extraction sidecar on every backend: OpenAI reasoning pin, Claude thinking budget or output_config effort derived from provider-core caps, or set_reasoning_effort on the sidecar's independent provider fork. Empty strings trim to unset; runtime panel shows it next to the memory model row (#1639).

The runtime panel gains rows for the selected model and agents.* model overrides (#1634).

The separate Swarm, Commits and Compaction margin widgets fold into one always-visible Overview (order: Runtime, Todos, Memory, Background, Usage, KV, Compaction, Changes, Commits, Swarm). Includes a placement fix: mergeable widgets could anchor into the only margin pocket before the Overview had data and squat it indefinitely; placement now retries once without mergeable anchors when the Overview is available but unplaced. MemoryActivity stays a dedicated widget since the Overview strips memory_info.

Tests: 245 new/expanded info-widget tests cover folding order, runtime rows, memory_effort plumbing and placement retry, plus placement-state isolation locks (the widget placement state is process-global). Full-suite failures observed locally are the known upstream flakes (restore_session, ambient refresh, model picker copilot, cost_based_usage, state_persists_show_count), all reproducible on current master. Single commit rebased onto current master.

…onfig

Replace the separate Swarm, Commits and Compaction margin widgets with
one always-visible Overview that folds them in as sections, order
matching master: Runtime, Todos, Memory, Background, Usage, KV,
Compaction, Changes, Commits, Swarm. Any single section is enough to
place it; memory stays in its dedicated MemoryActivity widget, same as
master. The runtime panel gains rows for model and agent overrides.

Placement fix: mergeable widgets could anchor into the only margin
pocket before the Overview had data and squat it indefinitely.
Placement now retries once without the mergeable anchors when the
Overview is available but not placed, adopting the retry only if the
Overview actually lands. MemoryActivity is deliberately not mergeable:
the Overview strips memory_info, so suppressing it would hide the only
renderer of it.

New agents.memory_effort key (env JCODE_MEMORY_EFFORT) pins the
reasoning effort of the memory extraction sidecar on every backend:
OpenAI reasoning pin, Claude thinking budget or output_config effort
derived from provider-core caps, or set_reasoning_effort on the
sidecar's independent provider fork. Empty strings trim to unset. The
runtime panel shows it next to the memory model row.
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds memory effort config and overview widget folding.

Do not merge until memory-sidecar construction stops changing the live Copilot session’s effort. The other findings do not independently block merging.

Findings

  1. P1 Sidecar changes live effort ▶
  2. P2 Claude effort is omitted ▶
  3. P2 Remote panel shows local overrides ▶
  4. P2 Test leaves deleted home ▶
  5. P2 Effort-only setting stays hidden ▶
Fix with agent prompt
### Issue 1
crates/jcode-base/src/sidecar.rs:197-203
When the active provider is Copilot `claude-sonnet-5`, its fork shares the live provider’s effort setting. Setting `agents.memory_effort` here changes the effort used by subsequent main-agent requests instead of isolating it to memory extraction. This must be fixed before merging.

### Issue 2
crates/jcode-base/src/sidecar.rs:1195-1198
With `claude-sonnet-3-7` and the sidecar’s default 1,024-token output limit, the thinking budget falls below its minimum. The request then contains neither `thinking` nor an `output_config` effort setting. The configured memory effort has no effect for this model; this narrower configuration defect does not independently block merging.

### Issue 3
crates/jcode-tui/src/tui/app/tui_state.rs:1652-1655
In an SSH session, the selected model and effort reflect remote state, but these swarm and memory rows read the client’s local configuration. When the hosts differ, Runtime shows the wrong overrides or omits ones used by the server. This makes remote settings harder to diagnose but does not independently block merging.

### Issue 4
crates/jcode-base/src/sidecar.rs:1470-1473
This test changes the process-wide `JCODE_HOME` without restoring it. After its temporary directory is removed, later tests in the same process can resolve configuration or storage through a deleted path. The resulting order-dependent test failures are a non-blocking test-isolation concern.

### Issue 5
crates/jcode-tui/src/tui/info_widget_model.rs:124-126
`JCODE_MEMORY_EFFORT` can set sidecar effort without a memory-model override, but Runtime renders the memory row only when a model override exists. Users with an effort-only setting cannot verify it in the panel; this visibility gap does not independently block merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR adds configurable memory-sidecar effort, model rows in Runtime, and a consolidated Overview. Constructing a memory sidecar can change a live Copilot session’s effort, which must be fixed before merging. The configured effort is also omitted from default-length Sonnet 3.7 requests. Runtime can show client overrides as remote settings and hides effort-only memory settings; a new test leaves JCODE_HOME pointing to a deleted directory.

Reviews (1) · Last reviewed commit: "feat(tui): overview folding widget and a..."

Comment on lines +197 to +203
provider: provider.inspect(|fork| {
// The fork is independent of the main agent (per the Provider
// fork contract), so pinning `agents.memory_effort` on it
// never disturbs the user's live session effort. Providers
// without an effort knob reject; keep their default.
if let Some(effort) = configured_effort.as_deref()
&& let Err(err) = fork.set_reasoning_effort(effort)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Sidecar changes live effort

When the active provider is Copilot claude-sonnet-5, its fork shares the live provider’s effort setting. Setting agents.memory_effort here changes the effort used by subsequent main-agent requests instead of isolating it to memory extraction. This must be fixed before merging.

Knowledge Base Used: Model provider integration

Artifacts

Evidence from the check

  • The authored Rust integration test constructs the real Copilot provider and sidecar without contacting an external service, then checks that live effort remains high.

Command output from the check

  • The executed test passed with memory effort unset and live effort still high, establishing the comparison condition.

Command output from the check

  • The executed test failed because sidecar construction changed live effort from high to low, reproducing the defect.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/sidecar.rs
Line: 197-203

Comment:
**Sidecar changes live effort**

When the active provider is Copilot `claude-sonnet-5`, its fork shares the live provider’s effort setting. Setting `agents.memory_effort` here changes the effort used by subsequent main-agent requests instead of isolating it to memory extraction. This must be fixed before merging.

**Knowledge Base Used:** [Model provider integration](https://app.greptile.com/solo-systems/-/custom-context/knowledge-base/1jehuang/jcode/-/docs/provider-integration.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +1195 to +1198
let budget = budget.min(max_tokens.saturating_sub(1));
if budget < 1_024 {
None
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Claude effort is omitted

With claude-sonnet-3-7 and the sidecar’s default 1,024-token output limit, the thinking budget falls below its minimum. The request then contains neither thinking nor an output_config effort setting. The configured memory effort has no effect for this model; this narrower configuration defect does not independently block merging.

Knowledge Base Used: Model provider integration

Artifacts

Evidence from the check

  • This authored command extracts and compiles the parent or current request code and prints its serialized bodies, making the two runs reproducible.

Command output from the check

  • The parent-code harness ran successfully and emitted requests without reasoning fields at all three tested token limits, establishing the baseline.

Command output from the check

  • The current-code harness ran successfully and showed effort omitted at 1,024 tokens but manual thinking present at 1,025 and 2,000 tokens, confirming the clamp boundary.

Command output from the check

  • The focused Cargo test passed; it does not cover the manual-only Sonnet 3.7 default-limit case.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/sidecar.rs
Line: 1195-1198

Comment:
**Claude effort is omitted**

With `claude-sonnet-3-7` and the sidecar’s default 1,024-token output limit, the thinking budget falls below its minimum. The request then contains neither `thinking` nor an `output_config` effort setting. The configured memory effort has no effect for this model; this narrower configuration defect does not independently block merging.

**Knowledge Base Used:** [Model provider integration](https://app.greptile.com/solo-systems/-/custom-context/knowledge-base/1jehuang/jcode/-/docs/provider-integration.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +1652 to +1655
swarm_model_override: crate::config::config().agents.swarm_model.clone(),
swarm_model_effort: crate::config::config().agents.swarm_effort.clone(),
memory_model_override: crate::config::config().agents.memory_model.clone(),
memory_model_effort: crate::config::config().agents.memory_effort.clone(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Remote panel shows local overrides

In an SSH session, the selected model and effort reflect remote state, but these swarm and memory rows read the client’s local configuration. When the hosts differ, Runtime shows the wrong overrides or omits ones used by the server. This makes remote settings harder to diagnose but does not independently block merging.

Knowledge Base Used: Interactive user interfaces

Artifacts

Evidence from the check

  • The temporary Rust test defines differing client and simulated server settings and renders the actual widget; it exercises the disputed data path.

Evidence from the check

  • The runner temporarily includes and executes the Rust test for both client configurations, then restores the source file; no product edit remains.

Command output from the check

  • The first Rust test passed and rendered the server-selected model without agent override rows; the differing simulated server overrides were not displayed.

Command output from the check

  • The second Rust test passed and rendered client swarm and memory overrides beside the server-selected model; the remote panel mixed settings sources.

▶ Recording of the check

  • Chromium recorded playback of the first passing Rust terminal buffer; only the server-selected model appears.

Runtime panel with client overrides unset

  • Chromium captured the first passing Rust terminal buffer; agent override rows are absent.

▶ Recording of the check

  • Chromium recorded playback of the second passing Rust terminal buffer; client override rows appear beside the server-selected model.

Runtime panel displaying client overrides beside server selection

  • Chromium captured the second passing Rust terminal buffer; the agent rows show client values rather than the simulated server values.

Evidence from the check

  • The script replays the successful Rust terminal buffers in Chromium and captures matching videos and poster frames; the images depict executed test output.

Command output from the check

  • The recorded command exited successfully and produced both playback videos and poster frames; visual capture completed.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-tui/src/tui/app/tui_state.rs
Line: 1652-1655

Comment:
**Remote panel shows local overrides**

In an SSH session, the selected model and effort reflect remote state, but these swarm and memory rows read the client’s local configuration. When the hosts differ, Runtime shows the wrong overrides or omits ones used by the server. This makes remote settings harder to diagnose but does not independently block merging.

**Knowledge Base Used:** [Interactive user interfaces](https://app.greptile.com/solo-systems/-/custom-context/knowledge-base/1jehuang/jcode/-/docs/interactive-user-interfaces.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +1470 to +1473
let _guard = crate::storage::lock_test_env();
let dir = tempfile::TempDir::new().expect("tempdir");
crate::env::set_var("JCODE_HOME", dir.path());
std::fs::write(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Test leaves deleted home

This test changes the process-wide JCODE_HOME without restoring it. After its temporary directory is removed, later tests in the same process can resolve configuration or storage through a deleted path. The resulting order-dependent test failures are a non-blocking test-isolation concern.

Artifacts

Evidence from the check

  • This authored command builds the observer and runs each real test with the same initial home, producing the comparison logs.

Evidence from the check

  • This authored observer runs as the test process exits and checks its final JCODE_HOME, making the post-test state visible.

Command output from the check

  • The comparable guarded test passed, and its process exited with the original JCODE_HOME still pointing to an existing directory.

Command output from the check

  • The candidate test passed, but its process exited with JCODE_HOME pointing to a deleted temporary directory.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/sidecar.rs
Line: 1470-1473

Comment:
**Test leaves deleted home**

This test changes the process-wide `JCODE_HOME` without restoring it. After its temporary directory is removed, later tests in the same process can resolve configuration or storage through a deleted path. The resulting order-dependent test failures are a non-blocking test-isolation concern.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +124 to +126
if let Some(model) = non_empty(data.memory_model_override.as_deref()) {
let mut text = model.to_string();
if let Some(effort) = non_empty(data.memory_model_effort.as_deref()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Effort-only setting stays hidden

JCODE_MEMORY_EFFORT can set sidecar effort without a memory-model override, but Runtime renders the memory row only when a model override exists. Users with an effort-only setting cannot verify it in the panel; this visibility gap does not independently block merging.

Artifacts

Evidence from the check

  • This authored command temporarily adds and runs the focused render test, then restores the source file; it is the executable reproduction.

Command output from the check

  • The executed test prints all three rendered panels and passes its assertions; the effort-only panel matches the baseline.

Evidence from the check

  • This authored Playwright script displays the cells captured by the Rust test and records the comparison; it does not invent UI output.

Command output from the check

  • The executed Playwright command reports successful baseline and effort-only captures; both lack a memory row.

▶ Recording of the check

  • Chromium displays the baseline Rust-rendered panel without a memory override; it contains only the session model row.

Poster of the baseline runtime panel

  • The captured baseline frame shows the session model row and no memory row.

▶ Recording of the check

  • Chromium displays the Rust-rendered panel with `JCODE_MEMORY_EFFORT=low` and no memory model override; the memory row is still absent.

Poster of the effort-only runtime panel

  • The captured effort-only frame looks like the baseline despite the configured sidecar effort.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-tui/src/tui/info_widget_model.rs
Line: 124-126

Comment:
**Effort-only setting stays hidden**

`JCODE_MEMORY_EFFORT` can set sidecar effort without a memory-model override, but Runtime renders the memory row only when a model override exists. Users with an effort-only setting cannot verify it in the panel; this visibility gap does not independently block merging.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant