fix: prevent session loss and repair launch lifecycle races - #820
fix: prevent session loss and repair launch lifecycle races#8201jehuang wants to merge 45 commits into
Conversation
|
CI follow-through found and repaired three unrelated guardrail regressions already present on the base branch: a collapsible conditional, a dead auth helper, and a contradictory strict-schema fixture. The focused suites now pass locally. The repository-wide guardrail is still blocked by two additional pre-existing Rust 1.97 clippy findings in --- — Jcode agent (automated triage), on behalf of @1jehuang |
|
Final CI follow-through: the issue-specific SDK and sidecar checks continue to pass, and the bounded Rust 1.97 findings fixed on this branch are resolved. The repository-wide guardrail now advances into --- — Jcode agent (automated triage), on behalf of @1jehuang |
|
Runtime acceptance check for #818 passed: a selfdev build of this branch completed, then 8 concurrent public SDK --- — Jcode agent (automated triage), on behalf of @1jehuang |
Greptile SummaryThis change updates daemon shutdown polling, terminal spawn-hook handling, scheduled-turn rendering, transcript checkpoint safeguards, sidecar model selection, and related tests and release metadata. A focused persisted-session test reproduced a role-boundary failure: an ordinary user message beginning with T-Rex validation blockedThe executed reproduction artifacts could not be uploaded because the required Greptile artifact-upload tool was unavailable. The saved local test source and output cannot be presented as uploaded evidence. Confidence Score: 4/5
|
|
Acceptance follow-up:
--- — Jcode agent (automated triage), on behalf of @1jehuang |
| Some(StoredDisplayRole::System) => "system", | ||
| Some(StoredDisplayRole::BackgroundTask) => "background_task", | ||
| None if is_auto_poke_user_message(msg) => "system", | ||
| None if super::is_scheduled_task_message(msg) => "system", |
There was a problem hiding this comment.
User messages gain system role
An ordinary persisted Role::User message with no explicit display role can begin with [Scheduled task]\n and match the legacy scheduled-task classifier. This branch then renders user-controlled content with the system role; the same classifier also removes it from visible-conversation accounting. Determine scheduled-task status from trusted scheduler provenance or an explicit persisted marker, not user-controlled text.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-base/src/session/render.rs
Line: 415
Comment:
**User messages gain system role**
An ordinary persisted `Role::User` message with no explicit display role can begin with `[Scheduled task]\n` and match the legacy scheduled-task classifier. This branch then renders user-controlled content with the `system` role; the same classifier also removes it from visible-conversation accounting. Determine scheduled-task status from trusted scheduler provenance or an explicit persisted marker, not user-controlled text.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
close()gives upservers.jsonpublication with a regression teststartup queuedFixes #818.
Fixes #798.
Fixes #814.
Fixes #792.
Verification
npm test -- --test-name-pattern="daemon shutdown lookup|cleanup refuses|removing an instance"cargo test -p jcode-base --lib sidecar::cargo test -p jcode-base session::persistence::tests --lib(3 passed)cargo test -p jcode-base terminal_launch::tests --libcargo test -p jcode-app-core server::comm_session_tests::prepare_visible_spawn_session --libgit diff --checkcargo fmt --all -- --check--- — Jcode agent (automated triage), on behalf of @1jehuang