Skip to content

Commit 4047cda

Browse files
pRizzclaude
andcommitted
fix: clear stale browser cache after reset and improve reset messaging
Bumps opencode submodule with epoch-based browser cache invalidation: the server generates a unique epoch on first boot, and the frontend clears localStorage when the epoch changes (e.g. after volume wipe). Adds a CLI hint after `reset host` and `reset container --volumes` telling users to clear browser data (for older frontend versions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5c0d9b4 commit 4047cda

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

packages/cli-rust/src/commands/reset/mod.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ async fn cmd_reset_container(
435435

436436
if args.volumes {
437437
remove_volumes_with_spinner(&client, host_name.as_deref(), quiet, &mut errors).await;
438+
print_browser_cache_hint(quiet);
438439
}
439440

440441
if args.images {
@@ -653,6 +654,8 @@ async fn cmd_reset_host(
653654
remove_dir_if_exists(get_config_dir(), "config", quiet, &mut errors);
654655
remove_dir_if_exists(get_data_dir(), "data", quiet, &mut errors);
655656

657+
print_browser_cache_hint(quiet);
658+
656659
if errors.is_empty() {
657660
Ok(())
658661
} else {
@@ -664,6 +667,29 @@ async fn cmd_reset_host(
664667
}
665668
}
666669

670+
fn print_browser_cache_hint(quiet: bool) {
671+
if quiet {
672+
return;
673+
}
674+
println!();
675+
println!(
676+
"{}",
677+
style("Note: If you previously accessed the web UI in a browser,").yellow()
678+
);
679+
println!(
680+
"{}",
681+
style("clear site data to avoid stale sessions on older versions:").yellow()
682+
);
683+
println!(
684+
" {}",
685+
style("Browser DevTools > Application > Storage > Clear site data").dim()
686+
);
687+
println!(
688+
" {}",
689+
style("Newer versions clear browser cache automatically on next load.").dim()
690+
);
691+
}
692+
667693
fn uninstall_service_registration(quiet: bool, errors: &mut Vec<String>) {
668694
if !is_service_registration_supported() {
669695
return;

0 commit comments

Comments
 (0)