🙌 OpenHands: AI-Driven Development
fix(conversation-panel): treat a missing-runtime conversation as archived everywhere (#18159)
Admin Cipansor3a68e045223f
diff --git a/.pr/design.html b/.pr/design.htmlnew file mode 100644index 0000000000..e6dd63d341--- /dev/null+++ b/.pr/design.html@@ -0,0 +1,310 @@+<!doctype html>+<html lang="en"><head><meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>Unify the archived conversation predicate — #18155</title>+<style>+ :root{+ --fg:#1a1a1a; --muted:#5a5a5a; --subtle:#8a8a82;+ --bg:#fdfdfb; --card:#ffffff; --elevated:#f7f6f1;+ --accent:#2b4eaa; --accent-soft:#e6ecfa;+ --rule:#e2e2dc; --rule-strong:#bdbcb4;+ --code-bg:#f3f1ec; --warn:#b25b0e; --ok:#2f7a3a; --crit:#a02020; --changed:#c2570a;+ --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;+ --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;+ }+ *{box-sizing:border-box} html,body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--sans)}+ body{line-height:1.6;font-size:16px}+ .wrap{display:grid;grid-template-columns:250px minmax(0,1fr);gap:48px;max-width:1180px;margin:0 auto;padding:32px 28px 96px}+ nav.toc{position:sticky;top:24px;align-self:start;font-size:13px}+ nav.toc h2{font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin:0 0 10px}+ nav.toc ol{list-style:none;padding:0;margin:0;counter-reset:toc}+ nav.toc li{counter-increment:toc;margin:4px 0}+ nav.toc li::before{content:counter(toc) ". ";color:var(--muted)}+ nav.toc a{color:var(--fg);text-decoration:none} nav.toc a:hover{color:var(--accent)}+ header.title{border-bottom:1px solid var(--rule);padding-bottom:22px;margin-bottom:28px}+ header.title .eyebrow{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--accent);font-weight:700}+ header.title h1{font-size:32px;margin:6px 0 4px;letter-spacing:-.01em}+ header.title .sub{color:var(--muted);max-width:760px}+ h2{font-size:22px;margin:44px 0 10px} h2 .num{color:var(--muted);font-weight:500;margin-right:8px}+ h3{font-size:16px;margin:22px 0 8px}+ code{font-family:var(--mono);font-size:.88em;background:var(--code-bg);padding:1px 5px;border-radius:3px}+ pre{font-family:var(--mono);font-size:13px;background:var(--code-bg);padding:14px 16px;border-radius:6px;overflow-x:auto;border:1px solid var(--rule)}+ pre code{background:transparent;padding:0}+ .kw{color:#7048a8}.str{color:var(--ok)}.com{color:var(--subtle);font-style:italic}+ table{border-collapse:collapse;width:100%;font-size:14px;margin:12px 0}+ th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--rule);vertical-align:top}+ th{font-weight:600;background:var(--code-bg)}+ .callout{border-left:3px solid var(--accent);background:var(--accent-soft);padding:10px 14px;margin:14px 0;border-radius:0 4px 4px 0;font-size:14.5px}+ .callout.warn{border-color:var(--warn);background:#fbf1e6} .callout.note{border-color:var(--muted);background:#f3f1ec}+ .fig{margin:18px 0 22px}+ .fig svg{display:block;max-width:100%;height:auto;background:#fff;border:1px solid var(--rule);border-radius:6px}+ .fig figcaption{font-size:13px;color:var(--muted);margin-top:6px;text-align:center}+ a.src{font-family:var(--mono);font-size:11.5px;color:var(--accent);text-decoration:none;border-bottom:1px dotted var(--accent)}+ details{border:1px solid var(--rule);border-radius:6px;margin:12px 0}+ details>summary{cursor:pointer;padding:8px 12px;color:var(--muted);font-size:13px;list-style:none}+ details>summary::-webkit-details-marker{display:none}+ details>summary::before{content:"▸ "} details[open]>summary::before{content:"▾ "}+ .ba{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}+ .legend{font-size:12px;color:var(--muted);display:flex;gap:16px;flex-wrap:wrap;margin:6px 0 0}+ .legend span::before{content:"■ ";color:var(--changed)} .legend span.g::before{color:var(--ok)} .legend span.r::before{color:var(--crit)} .legend span.n::before{color:var(--rule-strong)}+ @media(max-width:760px){.wrap{grid-template-columns:1fr}.ba{grid-template-columns:1fr}}+</style></head><body>+<div class="wrap">+ <nav class="toc"><h2>Contents</h2><ol>+ <li><a href="#sec1">The bug: two archived notions</a></li>+ <li><a href="#sec2">One predicate, two concerns</a></li>+ <li><a href="#sec3">API before → after</a></li>+ <li><a href="#sec4">Per-file changes</a></li>+ <li><a href="#sec5">Evidence</a></li>+ </ol></nav>+ <main>+ <header class="title">+ <div class="eyebrow">Bug fix · Agent Canvas frontend</div>+ <h1>Unify the archived conversation predicate</h1>+ <p class="sub">The conversation list had two independent notions of "archived" that disagreed: the+ status dot dimmed and labelled a missing-runtime row "Archived", while list visibility, the+ "Archived" chip, and the ⋮ menu still treated it as active. This PR derives every archived+ presentation from one predicate, and stops conflating a missing runtime with an errored one.</p>+ </header>++ <p style="font-size:13.5px;color:var(--muted)">14 source/test files · <b style="color:var(--ok)">+538</b> / <b style="color:var(--crit)">−30</b> · no dependency or wire-contract changes · fixes+ <a class="src" href="https://github.com/OpenHands/OpenHands/issues/18155">#18155</a></p>++ <div class="callout"><b>★ Key takeaway.</b> A row is now "effectively archived" when the user archived it+ <i>or</i> its runtime is missing and non-resumable; that one predicate drives list visibility, the+ "Archived" chip, and the status dot. <code>ERROR</code> keeps its red "Error" indicator and is never+ archived. Menu availability is separate: <em>Unarchive</em> is offered only when clearing the explicit+ archive flag actually returns the row to the default list, so a missing, non-resumable runtime offers+ neither direction. The single new symbol is+ <a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/utils/conversation-archive-status.ts#L43">isEffectivelyArchivedConversation · src/utils/conversation-archive-status.ts:43</a>.</div>++ <section id="sec1">+ <h2><span class="num">1</span>The bug: two archived notions disagreed</h2>+ <p>After an automation run finished, its conversation's runtime was torn down and could not be+ resumed. The backend reported <code>sandbox_status: "MISSING"</code> (Cloud) or+ <code>runtime_info.runtime_status: "missing"</code> + <code>can_resume: false</code> (local). The row+ then rendered the gray archive icon, tooltip "Archived", and a dimmed title — but it stayed in the+ default list, showed no "Archived" chip, and its ⋮ menu still offered "Archive".</p>++ <figure class="fig">+ <svg viewBox="0 0 720 250" role="img" aria-label="Before: two archive sources feed different surfaces">+ <defs><marker id="ar" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto"><path d="M0,0 L7,3 L0,6 z" fill="var(--rule-strong)"/></marker></defs>+ <text x="16" y="22" font-size="12" font-weight="700" fill="var(--crit)">BEFORE — two sources, two answers</text>+ <rect x="20" y="44" width="200" height="66" rx="6" fill="var(--card)" stroke="var(--rule-strong)"/>+ <text x="34" y="68" font-size="12" font-weight="700">sandbox_status</text>+ <text x="34" y="88" font-size="11" fill="var(--muted)">MISSING / ERROR</text>+ <text x="34" y="103" font-size="10.5" fill="var(--muted)">isArchivedSandboxStatus()</text>+ <rect x="500" y="44" width="200" height="66" rx="6" fill="var(--card)" stroke="var(--rule-strong)"/>+ <text x="514" y="68" font-size="12" font-weight="700">localStorage</text>+ <text x="514" y="88" font-size="11" fill="var(--muted)">archived-conversations</text>+ <text x="514" y="103" font-size="10.5" fill="var(--muted)">explicit user archive</text>+ <path d="M220 77 L500 77" stroke="var(--rule-strong)" stroke-width="1.4" marker-end="url(#ar)"/>+ <text x="360" y="70" font-size="10.5" fill="var(--muted)" text-anchor="middle">do not agree</text>+ <path d="M120 110 L120 168" stroke="var(--rule-strong)" stroke-width="1.4" marker-end="url(#ar)"/>+ <path d="M600 110 L600 168" stroke="var(--rule-strong)" stroke-width="1.4" marker-end="url(#ar)"/>+ <rect x="40" y="172" width="180" height="52" rx="6" fill="#fdf3ef" stroke="var(--crit)"/>+ <text x="54" y="193" font-size="11">dot · dimmed title</text>+ <text x="54" y="209" font-size="11">read-only (WS, chat)</text>+ <rect x="470" y="172" width="230" height="52" rx="6" fill="#fdf3ef" stroke="var(--crit)"/>+ <text x="484" y="193" font-size="11">list visibility · chip</text>+ <text x="484" y="209" font-size="11">⋮ menu direction</text>+ <text x="120" y="240" font-size="10.5" fill="var(--crit)" text-anchor="middle">shown "Archived"</text>+ <text x="585" y="240" font-size="10.5" fill="var(--crit)" text-anchor="middle">behaved "active"</text>+ </svg>+ <figcaption>A missing-runtime row was painted as archived by the sandbox status, but list/chip/menu read the local store — so the row looked archived while behaving as active.</figcaption>+ </figure>++ <div class="callout warn"><b>⚠ Also wrong.</b> <code>isArchivedSandboxStatus</code> returned true for both+ <code>MISSING</code> and <code>ERROR</code>, so an errored runtime got the dimmed title and skipped its+ WebSocket — even though the status dot renders <code>ERROR</code> as a red "Error" dot, not as archived.</div>+ </section>++ <section id="sec2">+ <h2><span class="num">2</span>One predicate, two concerns split apart</h2>+ <p>The old single helper mixed a <b>runtime</b> concern (is the sandbox gone?) with an <b>archive</b>+ concern (should this row present as archived?). The fix names each:</p>+ <table>+ <tr><th>Concern</th><th>Symbol</th><th>Returns true for</th><th>Drives</th></tr>+ <tr><td>Runtime unavailable (read-only)</td><td><code>isRuntimeUnavailableSandboxStatus</code></td><td>MISSING, ERROR</td><td>WebSocket gating, chat input, git/panel toggles</td></tr>+ <tr><td>Missing & non-resumable</td><td><code>isMissingSandboxStatus</code></td><td>MISSING</td><td>status dot "Archived", dimmed title</td></tr>+ <tr><td><b>Effective archived</b></td><td><code>isEffectivelyArchivedConversation</code></td><td>explicit archive <b>or</b> MISSING</td><td>list visibility, "Archived" chip, status dot</td></tr>+ </table>+ <div class="callout note"><b>ⓘ Why ERROR stays read-only but not archived.</b> An errored sandbox is+ also gone and cannot be resumed, so its runtime-backed affordances remain read-only+ (<a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/contexts/websocket-provider-wrapper.tsx#L101">websocket-provider-wrapper.tsx:101</a>).+ But it is not "archived": it keeps the red Error dot and never gets the chip, so it is not conflated+ with MISSING.</div>++ <figure class="fig">+ <svg viewBox="0 0 720 220" role="img" aria-label="After: one predicate feeds every archived surface">+ <defs><marker id="ar2" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto"><path d="M0,0 L7,3 L0,6 z" fill="var(--accent)"/></marker></defs>+ <text x="16" y="22" font-size="12" font-weight="700" fill="var(--ok)">AFTER — one predicate, one answer</text>+ <rect x="250" y="40" width="230" height="58" rx="6" fill="var(--accent-soft)" stroke="var(--accent)"/>+ <text x="264" y="63" font-size="12" font-weight="700">isEffectivelyArchived</text>+ <text x="264" y="80" font-size="10.5" fill="var(--muted)">explicit || isMissing(status)</text>+ <text x="264" y="93" font-size="10" fill="var(--muted)">conversation-archive-status.ts:38</text>+ <path d="M365 98 L365 128" stroke="var(--accent)" stroke-width="1.4" marker-end="url(#ar2)"/>+ <rect x="70" y="134" width="180" height="46" rx="6" fill="var(--card)" stroke="var(--ok)"/>+ <text x="84" y="154" font-size="11">list visibility</text>+ <text x="84" y="170" font-size="11">(default hides it)</text>+ <rect x="270" y="134" width="180" height="46" rx="6" fill="var(--card)" stroke="var(--ok)"/>+ <text x="284" y="154" font-size="11">"Archived" chip</text>+ <text x="284" y="170" font-size="11">under "Show archived"</text>+ <rect x="470" y="134" width="180" height="46" rx="6" fill="var(--card)" stroke="var(--ok)"/>+ <text x="484" y="154" font-size="11">status dot / title</text>+ <text x="484" y="170" font-size="11">archive icon + dimmed</text>+ <path d="M365 180 L365 196" stroke="var(--accent)" stroke-width="1.2"/>+ <text x="365" y="212" font-size="10.5" fill="var(--muted)" text-anchor="middle">conversation-panel.tsx:208 isRowArchived()</text>+ </svg>+ <figcaption>Every archived presentation now reads the same predicate, so the surfaces cannot disagree.</figcaption>+ </figure>+ </section>++ <section id="sec3">+ <h2><span class="num">3</span>API before → after</h2>+ <div class="ba">+ <div>+ <h3>Before</h3>+ <pre><code><span class="com">// one helper, two meanings</span>+<span class="kw">export function</span> isArchivedSandboxStatus(+ s: SandboxStatus | <span class="kw">null</span> | <span class="kw">undefined</span>,+): <span class="kw">boolean</span> {+ <span class="kw">return</span> s === <span class="str">"MISSING"</span>+ || s === <span class="str">"ERROR"</span>;+}++<span class="com">// list/chip/menu read the store, not this</span>+archivedIdSet.has(conversation.id)</code></pre>+ </div>+ <div>+ <h3>After</h3>+ <pre><code><span class="kw">export function</span> isMissingSandboxStatus(+ s: SandboxStatus | <span class="kw">null</span> | <span class="kw">undefined</span>,+): <span class="kw">boolean</span> { <span class="kw">return</span> s === <span class="str">"MISSING"</span>; }++<span class="kw">export function</span> isRuntimeUnavailableSandboxStatus(+ s: SandboxStatus | <span class="kw">null</span> | <span class="kw">undefined</span>,+): <span class="kw">boolean</span> {+ <span class="kw">return</span> s === <span class="str">"MISSING"</span> || s === <span class="str">"ERROR"</span>;+}++<span class="kw">export function</span> isEffectivelyArchivedConversation(+ s: SandboxStatus | <span class="kw">null</span> | <span class="kw">undefined</span>,+ explicitlyArchived: <span class="kw">boolean</span>,+): <span class="kw">boolean</span> {+ <span class="kw">return</span> explicitlyArchived || isMissingSandboxStatus(s);+}</code></pre>+ </div>+ </div>+ <p>Verdict: <b>internal refactor</b>. No exported API, wire contract, or TypeScript-client+ normalization changes; the renamed helpers are module-internal to Canvas.</p>+ </section>++ <section id="sec4">+ <h2><span class="num">4</span>Per-file changes</h2>+ <h3>✏️ The predicate — <a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/utils/conversation-archive-status.ts">src/utils/conversation-archive-status.ts</a></h3>+ <p>Splits the overloaded <code>isArchivedSandboxStatus</code> (MISSING||ERROR) into+ <code>isMissingSandboxStatus</code> (MISSING), <code>isRuntimeUnavailableSandboxStatus</code>+ (MISSING||ERROR), and the new <code>isEffectivelyArchivedConversation</code> (explicit || MISSING).</p>++ <h3>✏️ The panel — <a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/components/features/conversation-panel/conversation-panel.tsx#L212">conversation-panel.tsx:212</a></h3>+ <p>Adds one <code>isRowArchived(conversation)</code> callback. The display filter, the <code>isArchived</code>+ handed to cards, and the status dot all call it instead of <code>archivedIdSet.has(id)</code>.+ Delete/prune logic still reads the unfiltered loaded set, so hiding a row never shrinks what can be deleted.</p>+ <p>Menu availability is a <b>separate</b> concern from presentation+ (<a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/components/features/conversation-panel/conversation-panel.tsx#L989">conversation-panel.tsx:989</a>).+ The ⋮ menu offers at most one direction per row, and a missing, non-resumable runtime offers <b>neither</b>:</p>+ <ul style="font-size:14.5px;margin:8px 0">+ <li><b>Archive</b> — offered while the row is not effectively archived (same <code>isRowArchived</code>+ predicate as the chip and list visibility).</li>+ <li><b>Unarchive</b> — offered only for an explicitly archived row whose runtime is <i>not</i> missing+ (<code>explicitlyArchived && !isMissingSandboxStatus(...)</code>), i.e. only when clearing the+ browser-local flag actually returns the row to the unarchived state.</li>+ <li><b>Neither</b> — a missing, non-resumable runtime, including when a stored archive flag is also set:+ the missing runtime keeps the row archived, so clearing the flag would be a no-op the user cannot+ observe.</li>+ </ul>++ <h3>✏️ Status dot & dimmed title</h3>+ <p><a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/components/features/conversation-panel/conversation-status-dot.tsx#L128">conversation-status-dot.tsx</a>,+ <a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/components/features/conversation-panel/conversation-card/conversation-card-header.tsx#L25">conversation-card-header.tsx</a>,+ the hover preview, and the compact row all take the row's <b>effective archived</b> state+ (<code>isArchived</code>), not the raw sandbox status, so an explicitly archived row streams the gray+ archive dot and dimmed title even though its runtime is fine, and the dot can never disagree with the+ "Archived" chip. A missing sandbox is still inferred from <code>sandboxStatus</code> for callers that only+ have that, and an unarchived <code>ERROR</code> row keeps its red "Error" dot and badge.</p>++ <h3>✏️ Read-only gate</h3>+ <p><a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/hooks/use-is-archived-conversation.ts#L15">use-is-archived-conversation.ts:15</a>+ and <a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/contexts/websocket-provider-wrapper.tsx#L101">websocket-provider-wrapper.tsx:101</a>+ keep using <code>isRuntimeUnavailableSandboxStatus</code> (MISSING still read-only; ERROR stays read-only too, unchanged). The hook's docblock now states it is the read-only gate, not the archive predicate.</p>++ <h3>⚙️ Mechanical</h3>+ <p><a class="src" href="https://github.com/OpenHands/OpenHands/blob/261a7ef99091348fd39a49dbc9238bcca7cc311b/src/components/features/conversation-panel/compact-conversation-row.tsx">compact-conversation-row.tsx</a>+ gains an <code>isArchived</code> prop forwarded to the card preview so the compact layout shows the same chip.</p>+ </section>++ <section id="sec5">+ <h2><span class="num">5</span>Evidence — before vs after, real backend and mock fixtures</h2>+ <p>Two independent setups, both driving the real Canvas build:</p>+ <p><b>Real backend (primary).</b> A real agent server ran the shipped Canvas build against a conversation+ created locally, then restarted in <code>conversation_runtime: "docker"</code> mode. The server then reports+ <code>runtime_info.runtime_status: "missing"</code> with <code>can_resume: false</code> for that conversation —+ a genuine non-resumable runtime, not a fixture. The adapter maps it to <code>sandbox_status: "MISSING"</code>.+ "Before" is <code>main</code> @ <code>3f98684</code>; "after" is this PR's head; both served from the same+ origin so only the build differs. Captures are the <code>real-before-*</code> / <code>real-after-*</code> files.</p>+ <p><b>Mock fixtures (secondary).</b> Both builds also run in mock mode (<code>npm run dev:mock</code>) against+ the fixtures already on <code>main</code>: id 4 <code>MISSING</code> ("Archived Project") and id 5+ <code>ERROR</code> ("Errored Project") in <a class="src" href="https://github.com/OpenHands/OpenHands/blob/3f98684763a4e17e6e2faf8dd8f1cfc3969b020c/src/mocks/conversation-handlers.ts#L77">conversation-handlers.ts:77</a>,+ which additionally exercise the <code>ERROR</code> row. Captures are the <code>before-*</code> /+ <code>after-*</code> files. Driven with the verify-openhands Playwright browser.</p>+ <table>+ <tr><th>Observation</th><th>Before — main</th><th>After — this PR</th></tr>+ <tr><td>Real backend, default list (Show archived off)</td>+ <td>the genuine MISSING row is <b>shown</b> (bug) with no chip</td>+ <td>the MISSING row is <b>hidden</b></td></tr>+ <tr><td>Real backend, ⋮ menu on that row</td>+ <td><code>[…,"<b>Archive Conversation</b>","Delete Conversation"]</code></td>+ <td>neither direction — the row is missing-runtime, so "Archive" and "Unarchive" are both absent</td></tr>+ <tr><td>Default list (Show archived off)</td>+ <td>MISSING row <b>shown</b> with a gray archive dot + dimmed title, no chip</td>+ <td>MISSING row <b>hidden</b> (archived); ERROR row shown with red "Error"</td></tr>+ <tr><td>⋮ menu on the archived row</td>+ <td><code>["Rename","Edit tags","Stop Conversation","Download conversation data","<b>Archive Conversation</b>","Delete Conversation"]</code></td>+ <td>no "Archive" and no "Unarchive" — a missing, non-resumable runtime cannot change its effective archived state from this menu</td></tr>+ <tr><td>Explicitly archived row, runtime present</td>+ <td>—</td>+ <td>⋮ menu offers <b>Unarchive</b> (never "Archive"), and it returns the row to the default list</td></tr>+ <tr><td>ERROR row presentation</td>+ <td>red "Error" dot, but dimmed title (wrongly archived)</td>+ <td>red "Error" dot, title not dimmed, never chipped/archived</td></tr>+ </table>+ <p style="font-size:13.5px;color:var(--muted)">Thirteen captures (real-backend and mock, before · after+ each: default list, "Show archived", archived-row ⋮ menu, plus a mock explicitly-archived row offering+ Unarchive) are attached to the PR under <b>Video/Screenshots</b>. Unit/integration tests cover the+ predicate's MISSING/ERROR/local-non-resumable cases, the dot's MISSING→archive render, the panel's+ default-hide / show-archived behavior, and the menu offering neither direction on a missing-runtime row+ (including the both-explicitly-archived-and-missing case).</p>+ <div class="callout note"><b>ⓘ Where MISSING actually comes from.</b> The local (non-Docker) agent server+ reports every catalog conversation as <code>runtime_status: "available"</code>, so it never yields a+ <code>MISSING</code> row; the adapter maps <code>MISSING</code> from a Cloud+ <code>sandbox_status</code> or a Docker-runtime <code>runtime_info.runtime_status: "missing"</code> with+ <code>can_resume: false</code> (the <code>conversation_runtime: "docker"</code> mode). That mapping is pinned+ by <a class="src" href="https://github.com/OpenHands/OpenHands/blob/3f98684763a4e17e6e2faf8dd8f1cfc3969b020c/__tests__/api/agent-server-adapter.test.ts#L1008">agent-server-adapter.test.ts</a>+ (missing+non-resumable → <code>MISSING</code>; missing+resumable → <code>null</code>). The real-backend+ captures above reproduce exactly that: a conversation created in local mode, then read back after the server+ restarted in Docker mode, yields <code>runtime_status: "missing"</code> + <code>can_resume: false</code>.</div>+ <div class="callout note"><b>ⓘ Presentation vs. action availability.</b>+ Archive presentation and the ability to unarchive are not the same thing. The chip, dot, and list+ visibility all read <code>isRowArchived</code>; the ⋮ menu reads that plus whether the action can+ actually change the effective state. A row is offered <em>Archive</em> while it is not effectively+ archived, <em>Unarchive</em> only when it is explicitly archived <i>and</i> its runtime is not missing,+ and <em>neither</em> when the runtime is missing and non-resumable — clearing the browser-local flag+ would leave the missing runtime keeping the row archived, so it is not a useful Unarchive operation.+ An explicitly archived row whose runtime is present still offers <em>Unarchive</em>, which clears the+ flag and returns it to the default list.</div>+ </section>++ <p style="margin-top:40px;font-size:12.5px;color:var(--subtle)">Temporary review artifact under <code>.pr/</code>; removed after merge.</p>+ </main>+</div></body></html>diff --git a/.pr/evidence/after-1-default-list.png b/.pr/evidence/after-1-default-list.pngnew file mode 100644index 0000000000..91c9c3e920Binary files /dev/null and b/.pr/evidence/after-1-default-list.png differdiff --git a/.pr/evidence/after-2-show-archived.png b/.pr/evidence/after-2-show-archived.pngnew file mode 100644index 0000000000..b893d3c493Binary files /dev/null and b/.pr/evidence/after-2-show-archived.png differdiff --git a/.pr/evidence/after-3-archived-row-menu.png b/.pr/evidence/after-3-archived-row-menu.pngnew file mode 100644index 0000000000..55757d5c8dBinary files /dev/null and b/.pr/evidence/after-3-archived-row-menu.png differdiff --git a/.pr/evidence/after-4-explicit-unarchive.png b/.pr/evidence/after-4-explicit-unarchive.pngnew file mode 100644index 0000000000..d9e866b69dBinary files /dev/null and b/.pr/evidence/after-4-explicit-unarchive.png differdiff --git a/.pr/evidence/before-1-default-list.png b/.pr/evidence/before-1-default-list.pngnew file mode 100644index 0000000000..6e5326eafbBinary files /dev/null and b/.pr/evidence/before-1-default-list.png differdiff --git a/.pr/evidence/before-2-show-archived.png b/.pr/evidence/before-2-show-archived.pngnew file mode 100644index 0000000000..68bdb6df98Binary files /dev/null and b/.pr/evidence/before-2-show-archived.png differdiff --git a/.pr/evidence/before-3-archived-row-menu.png b/.pr/evidence/before-3-archived-row-menu.pngnew file mode 100644index 0000000000..09e154e163Binary files /dev/null and b/.pr/evidence/before-3-archived-row-menu.png differdiff --git a/.pr/evidence/real-after-1-default-list.png b/.pr/evidence/real-after-1-default-list.pngnew file mode 100644index 0000000000..8f7f5b2014Binary files /dev/null and b/.pr/evidence/real-after-1-default-list.png differdiff --git a/.pr/evidence/real-after-2-show-archived.png b/.pr/evidence/real-after-2-show-archived.pngnew file mode 100644index 0000000000..a4df440ea0Binary files /dev/null and b/.pr/evidence/real-after-2-show-archived.png differdiff --git a/.pr/evidence/real-after-3-archived-row-menu.png b/.pr/evidence/real-after-3-archived-row-menu.pngnew file mode 100644index 0000000000..f9cdc9f3d7Binary files /dev/null and b/.pr/evidence/real-after-3-archived-row-menu.png differdiff --git a/.pr/evidence/real-before-1-default-list.png b/.pr/evidence/real-before-1-default-list.pngnew file mode 100644index 0000000000..7e74d23c9fBinary files /dev/null and b/.pr/evidence/real-before-1-default-list.png differdiff --git a/.pr/evidence/real-before-2-show-archived.png b/.pr/evidence/real-before-2-show-archived.pngnew file mode 100644index 0000000000..1a1c149524Binary files /dev/null and b/.pr/evidence/real-before-2-show-archived.png differdiff --git a/.pr/evidence/real-before-3-archived-row-menu.png b/.pr/evidence/real-before-3-archived-row-menu.pngnew file mode 100644index 0000000000..e10acc3960Binary files /dev/null and b/.pr/evidence/real-before-3-archived-row-menu.png differdiff --git a/__tests__/components/features/conversation-panel/conversation-card-preview.test.tsx b/__tests__/components/features/conversation-panel/conversation-card-preview.test.tsxindex f6ece524cb..6b85537285 100644--- a/__tests__/components/features/conversation-panel/conversation-card-preview.test.tsx+++ b/__tests__/components/features/conversation-panel/conversation-card-preview.test.tsx@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";import { screen } from "@testing-library/react";import { renderWithProviders } from "test-utils";import { ConversationCardPreview } from "#/components/features/conversation-panel/conversation-card/conversation-card-preview";+import { ExecutionStatus } from "#/types/agent-server/core/base/common";const PREVIEW_TITLE = "Conversation 1";@@ -126,6 +127,26 @@ describe("ConversationCardPreview", () => {).not.toBeInTheDocument();});+ it("infers the archive dot from a missing runtime when isArchived is omitted", () => {+ // A hovercard that only knows the sandbox status must match the card's+ // missing-runtime archive presentation.+ renderWithProviders(+ <ConversationCardPreview+ title={PREVIEW_TITLE}+ selectedRepository={null}+ executionStatus={ExecutionStatus.FINISHED}+ sandboxStatus="MISSING"+ />,+ );++ expect(+ screen.getByTestId("conversation-status-archived"),+ ).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-status-check"),+ ).not.toBeInTheDocument();+ });+it("shows bare tags (empty value) with an em dash in the hovercard", () => {renderWithProviders(<ConversationCardPreviewdiff --git a/__tests__/components/features/conversation-panel/conversation-card.test.tsx b/__tests__/components/features/conversation-panel/conversation-card.test.tsxindex 915e121084..a062fd0ed3 100644--- a/__tests__/components/features/conversation-panel/conversation-card.test.tsx+++ b/__tests__/components/features/conversation-panel/conversation-card.test.tsx@@ -1298,4 +1298,59 @@ describe("ConversationCard", () => {).toBeVisible();expect(screen.getByRole("time")).toBeInTheDocument();});++ it("dims the title and grays the dot for an explicitly archived row with a present runtime", () => {+ // A RUNNING conversation archived through the menu: the chip, the dimmed+ // title, and the archive dot must agree even though the runtime is fine.+ renderWithProviders(+ <ConversationCard+ title="Conversation 1"+ selectedRepository={null}+ lastUpdatedAt="2021-10-01T12:00:00Z"+ executionStatus={ExecutionStatus.RUNNING}+ sandboxStatus="RUNNING"+ isArchived+ />,+ );++ const card = screen.getByTestId("conversation-card");+ expect(+ within(card).getByTestId("conversation-card-archived-chip"),+ ).toBeInTheDocument();+ expect(+ within(card).getByTestId("conversation-status-archived"),+ ).toBeInTheDocument();+ expect(within(card).getByTestId("conversation-card-title")).toHaveClass(+ "opacity-60",+ );+ });++ it("infers the archived presentation from a missing runtime when isArchived is omitted", () => {+ // Standalone callers that only know the sandbox status must still see the+ // archive dot, the dimmed title, and the chip — the false default used to+ // override the header's missing-runtime fallback.+ renderWithProviders(+ <ConversationCard+ title="Conversation 1"+ selectedRepository={null}+ lastUpdatedAt="2021-10-01T12:00:00Z"+ executionStatus={ExecutionStatus.FINISHED}+ sandboxStatus="MISSING"+ />,+ );++ const card = screen.getByTestId("conversation-card");+ expect(+ within(card).getByTestId("conversation-status-archived"),+ ).toBeInTheDocument();+ expect(+ within(card).queryByTestId("conversation-status-check"),+ ).not.toBeInTheDocument();+ expect(within(card).getByTestId("conversation-card-title")).toHaveClass(+ "opacity-60",+ );+ expect(+ within(card).getByTestId("conversation-card-archived-chip"),+ ).toBeInTheDocument();+ });});diff --git a/__tests__/components/features/conversation-panel/conversation-panel-actions.test.tsx b/__tests__/components/features/conversation-panel/conversation-panel-actions.test.tsxindex b2b978c1a8..5b0b27ba9a 100644--- a/__tests__/components/features/conversation-panel/conversation-panel-actions.test.tsx+++ b/__tests__/components/features/conversation-panel/conversation-panel-actions.test.tsx@@ -1,4 +1,4 @@-import { screen, waitFor, within } from "@testing-library/react";+import { screen, waitFor, within, act } from "@testing-library/react";import userEvent from "@testing-library/user-event";import { describe, expect, it, vi } from "vitest";import {@@ -173,6 +173,191 @@ describe("ConversationPanel conversation actions", () => {).not.toBeInTheDocument();});+ it("hides a missing-runtime conversation from the default list, reveals it with the Archived chip, and offers neither action", async () => {+ // A conversation whose runtime is gone (adapter maps a local+ // `runtime_info.runtime_status: "missing"` + `can_resume: false` to+ // `sandbox_status: "MISSING"`) must be treated as archived everywhere:+ // hidden by default and chipped when "Show archived" is on. Its ⋮ menu+ // offers neither "Archive" nor "Unarchive": the missing runtime cannot be+ // restored from here, so neither direction can change the effective state.+ vi.spyOn(+ AgentServerConversationService,+ "searchConversations",+ ).mockResolvedValue({+ items: [+ createMockConversation({ id: "live", title: "Live Conversation" }),+ createMockConversation({+ id: "gone",+ title: "Gone Conversation",+ sandbox_status: "MISSING",+ }),+ ],+ next_page_id: null,+ });++ renderConversationPanel();++ // Default list: the missing-runtime row is hidden like an archived row.+ let cards = await screen.findAllByTestId("conversation-card");+ expect(cards).toHaveLength(1);+ expect(screen.queryByText("Gone Conversation")).not.toBeInTheDocument();++ // "Show archived": the row reappears with the Archived chip.+ act(() => {+ useConversationPanelPreferencesStore.setState({+ showArchivedConversations: true,+ });+ });+ cards = await screen.findAllByTestId("conversation-card");+ expect(cards).toHaveLength(2);+ const goneCard = cards.find((card) =>+ within(card).queryByText("Gone Conversation"),+ )!;+ expect(goneCard).toBeInTheDocument();+ expect(+ within(goneCard).getByTestId("conversation-card-archived-chip"),+ ).toBeInTheDocument();++ // Neither direction is offered.+ await userEvent+ .setup()+ .click(within(goneCard).getByTestId("ellipsis-button"));+ expect(screen.queryByTestId("unarchive-button")).not.toBeInTheDocument();+ expect(screen.queryByTestId("archive-button")).not.toBeInTheDocument();+ });++ it("keeps a missing-runtime row presented as archived and offers no action", async () => {+ // A missing, non-resumable runtime keeps the row presented as archived:+ // the indicator, list visibility, and chip stay in agreement. The menu+ // offers neither direction because the runtime cannot be restored here.+ vi.spyOn(+ AgentServerConversationService,+ "searchConversations",+ ).mockResolvedValue({+ items: [+ createMockConversation({+ id: "gone",+ title: "Gone Conversation",+ sandbox_status: "MISSING",+ }),+ ],+ next_page_id: null,+ });+ useConversationPanelPreferencesStore.setState({+ showArchivedConversations: true,+ });++ renderConversationPanel();++ const goneCard = (await screen.findByText("Gone Conversation")).closest(+ "[data-testid='conversation-card']",+ )!;+ expect(+ within(goneCard as HTMLElement).getByTestId(+ "conversation-card-archived-chip",+ ),+ ).toBeInTheDocument();++ await userEvent+ .setup()+ .click(within(goneCard as HTMLElement).getByTestId("ellipsis-button"));+ expect(screen.queryByTestId("unarchive-button")).not.toBeInTheDocument();+ expect(screen.queryByTestId("archive-button")).not.toBeInTheDocument();++ // Still hidden from the default list.+ act(() => {+ useConversationPanelPreferencesStore.setState({+ showArchivedConversations: false,+ });+ });+ expect(screen.queryByText("Gone Conversation")).not.toBeInTheDocument();+ });++ it("offers Unarchive on an explicitly archived row with a present runtime", async () => {+ // An explicit archive whose sandbox is not missing is restorable, so its+ // ⋮ menu offers Unarchive and removing it returns the row to the default+ // list.+ useArchivedConversationsStore+ .getState()+ .archiveConversation("default-local", "1");+ useConversationPanelPreferencesStore.setState({+ showArchivedConversations: true,+ });++ renderConversationPanel();++ const cards = await screen.findAllByTestId("conversation-card");+ const archivedCard = cards.find((card) =>+ within(card).queryByText("Conversation 1"),+ )!;+ await userEvent+ .setup()+ .click(within(archivedCard).getByTestId("ellipsis-button"));+ expect(screen.getByTestId("unarchive-button")).toBeInTheDocument();+ expect(screen.queryByTestId("archive-button")).not.toBeInTheDocument();+ });++ it("offers neither action on a row that is both explicitly archived and missing its runtime", async () => {+ // A stored archive id on a missing-runtime row: the menu offers neither+ // direction. Clearing the id would not change the effective archived state+ // (the missing runtime keeps the row archived), so it is not a useful+ // Unarchive operation.+ vi.spyOn(+ AgentServerConversationService,+ "searchConversations",+ ).mockResolvedValue({+ items: [+ createMockConversation({+ id: "gone",+ title: "Gone Conversation",+ sandbox_status: "MISSING",+ }),+ ],+ next_page_id: null,+ });+ useArchivedConversationsStore+ .getState()+ .archiveConversation("default-local", "gone");+ useConversationPanelPreferencesStore.setState({+ showArchivedConversations: true,+ });++ renderConversationPanel();++ const goneCard = await screen.findByText("Gone Conversation");+ const card = goneCard.closest("[data-testid='conversation-card']")!;+ await userEvent+ .setup()+ .click(within(card as HTMLElement).getByTestId("ellipsis-button"));+ expect(screen.queryByTestId("unarchive-button")).not.toBeInTheDocument();+ expect(screen.queryByTestId("archive-button")).not.toBeInTheDocument();+ });++ it("keeps an ERROR runtime in the default list without the Archived chip", async () => {+ vi.spyOn(+ AgentServerConversationService,+ "searchConversations",+ ).mockResolvedValue({+ items: [+ createMockConversation({+ id: "errored",+ title: "Errored Conversation",+ sandbox_status: "ERROR",+ }),+ ],+ next_page_id: null,+ });++ renderConversationPanel();++ const cards = await screen.findAllByTestId("conversation-card");+ expect(cards).toHaveLength(1);+ expect(screen.getByText("Errored Conversation")).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-card-archived-chip"),+ ).not.toBeInTheDocument();+ });+it("should cancel stopping a conversation", async () => {const user = userEvent.setup();diff --git a/__tests__/components/features/conversation-panel/conversation-status-dot.test.tsx b/__tests__/components/features/conversation-panel/conversation-status-dot.test.tsxindex dd0abc5b15..91ccdd098f 100644--- a/__tests__/components/features/conversation-panel/conversation-status-dot.test.tsx+++ b/__tests__/components/features/conversation-panel/conversation-status-dot.test.tsx@@ -46,7 +46,9 @@ describe("ConversationStatusDot", () => {it("renders the unknown state for missing execution status", () => {renderWithProviders(<ConversationStatusDot executionStatus={undefined} />);- expect(screen.getByTestId("conversation-status-unknown")).toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-status-unknown"),+ ).toBeInTheDocument();expect(screen.getByTestId("styled-tooltip")).toHaveAttribute("data-content","COMMON$STOPPED",@@ -69,4 +71,60 @@ describe("ConversationStatusDot", () => {"COMMON$ARCHIVED",);});++ it("renders the error dot, not the archive icon, when sandbox is ERROR", () => {+ renderWithProviders(+ <ConversationStatusDot+ executionStatus={ExecutionStatus.FINISHED}+ sandboxStatus="ERROR"+ />,+ );++ expect(screen.getByTestId("conversation-status-error")).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-status-archived"),+ ).not.toBeInTheDocument();+ expect(screen.getByTestId("styled-tooltip")).toHaveAttribute(+ "data-content",+ "COMMON$ERROR",+ );+ });++ it("renders the archive icon for an explicitly archived row regardless of sandbox status", () => {+ renderWithProviders(+ <ConversationStatusDot+ executionStatus={ExecutionStatus.RUNNING}+ sandboxStatus="RUNNING"+ isArchived+ />,+ );++ expect(+ screen.getByTestId("conversation-status-archived"),+ ).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-status-working"),+ ).not.toBeInTheDocument();+ expect(screen.getByTestId("styled-tooltip")).toHaveAttribute(+ "data-content",+ "COMMON$ARCHIVED",+ );+ });++ it("prefers the archive presentation over the error dot when the row is archived", () => {+ renderWithProviders(+ <ConversationStatusDot+ executionStatus={ExecutionStatus.ERROR}+ sandboxStatus="ERROR"+ isArchived+ />,+ );++ expect(+ screen.getByTestId("conversation-status-archived"),+ ).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-status-error"),+ ).not.toBeInTheDocument();+ });});diff --git a/__tests__/utils/conversation-archive-status.test.ts b/__tests__/utils/conversation-archive-status.test.tsnew file mode 100644index 0000000000..816d35787a--- /dev/null+++ b/__tests__/utils/conversation-archive-status.test.ts@@ -0,0 +1,50 @@+import { describe, expect, it } from "vitest";+import {+ isEffectivelyArchivedConversation,+ isMissingSandboxStatus,+ isRuntimeUnavailableSandboxStatus,+} from "#/utils/conversation-archive-status";+import type { SandboxStatus } from "#/api/conversation-service/agent-server-conversation-service.types";++describe("conversation archive predicates", () => {+ it.each<[SandboxStatus | null | undefined, boolean]>([+ ["MISSING", true],+ ["ERROR", false],+ ["PAUSED", false],+ ["RUNNING", false],+ ["STARTING", false],+ [null, false],+ [undefined, false],+ ])("isMissingSandboxStatus(%s) === %s", (status, expected) => {+ expect(isMissingSandboxStatus(status)).toBe(expected);+ });++ it.each<[SandboxStatus | null | undefined, boolean]>([+ ["MISSING", true],+ ["ERROR", true],+ ["PAUSED", false],+ ["RUNNING", false],+ [null, false],+ [undefined, false],+ ])("isRuntimeUnavailableSandboxStatus(%s) === %s", (status, expected) => {+ expect(isRuntimeUnavailableSandboxStatus(status)).toBe(expected);+ });++ it("treats a missing runtime as effectively archived", () => {+ expect(isEffectivelyArchivedConversation("MISSING", false)).toBe(true);+ });++ it("treats an explicit archive as effectively archived", () => {+ expect(isEffectivelyArchivedConversation(null, true)).toBe(true);+ expect(isEffectivelyArchivedConversation("RUNNING", true)).toBe(true);+ });++ it("does not treat an errored runtime as archived on its own", () => {+ expect(isEffectivelyArchivedConversation("ERROR", false)).toBe(false);+ });++ it("does not treat a running runtime as archived on its own", () => {+ expect(isEffectivelyArchivedConversation("RUNNING", false)).toBe(false);+ expect(isEffectivelyArchivedConversation(null, false)).toBe(false);+ });+});diff --git a/src/components/features/conversation-panel/compact-conversation-row.tsx b/src/components/features/conversation-panel/compact-conversation-row.tsxindex 4ab3740dc7..debd5a5a4f 100644--- a/src/components/features/conversation-panel/compact-conversation-row.tsx+++ b/src/components/features/conversation-panel/compact-conversation-row.tsx@@ -11,6 +11,7 @@ import { ConversationStatusDot } from "./conversation-status-dot";import { ConversationCardFooter } from "./conversation-card/conversation-card-footer";import { I18nKey } from "#/i18n/declaration";import { useBackendScopedPath } from "#/hooks/use-backend-scoped-path";+import { isMissingSandboxStatus } from "#/utils/conversation-archive-status";interface CompactConversationRowProps {conversationId: string;@@ -31,6 +32,12 @@ interface CompactConversationRowProps {acpModels?: readonly ACPModelOption[] | null;tags?: Record<string, string> | null;showTags?: boolean;+ /**+ * The row's effective archived state. Leave undefined to infer it from+ * `sandboxStatus` (a missing, non-resumable runtime); the panel passes the+ * explicit value so the chip and dot agree with the full card.+ */+ isArchived?: boolean;}/**@@ -57,10 +64,12 @@ export function CompactConversationRow({acpModels = null,tags = null,showTags = false,+ isArchived,}: CompactConversationRowProps) {const { t } = useTranslation("openhands");const backendScopedPath = useBackendScopedPath();const disableAnimation = import.meta.env.MODE === "test";+ const effectiveArchived = isArchived ?? isMissingSandboxStatus(sandboxStatus);const preview = (<div className="w-65 p-3">@@ -68,6 +77,7 @@ export function CompactConversationRow({<ConversationStatusDotexecutionStatus={executionStatus}sandboxStatus={sandboxStatus}+ isArchived={effectiveArchived}showTooltip={false}/><span@@ -91,6 +101,7 @@ export function CompactConversationRow({acpModels={acpModels}tags={tags}showTags={showTags}+ isArchived={effectiveArchived}/></div>);@@ -120,6 +131,7 @@ export function CompactConversationRow({<ConversationStatusDotexecutionStatus={executionStatus}sandboxStatus={sandboxStatus}+ isArchived={effectiveArchived}showTooltip={false}/></NavigationLink>diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-header.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-header.tsxindex 00999b82eb..86f2d128cb 100644--- a/src/components/features/conversation-panel/conversation-card/conversation-card-header.tsx+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-header.tsx@@ -1,6 +1,6 @@import { ExecutionStatus } from "#/types/agent-server/core/base/common";import { SandboxStatus } from "#/api/conversation-service/agent-server-conversation-service.types";-import { isArchivedSandboxStatus } from "#/utils/conversation-archive-status";+import { isMissingSandboxStatus } from "#/utils/conversation-archive-status";import { ConversationCardTitle } from "./conversation-card-title";import { ConversationStatusDot } from "../conversation-status-dot";@@ -10,6 +10,13 @@ interface ConversationCardHeaderProps {onTitleSave: (title: string) => void;executionStatus?: ExecutionStatus | null;sandboxStatus?: SandboxStatus | null;+ /**+ * The row's effective archived state (explicit archive or missing runtime).+ * Dims the title and grays the status dot so both agree with the "Archived"+ * chip. Defaults to the runtime-derived case for callers that only know the+ * sandbox status.+ */+ isArchived?: boolean;}export function ConversationCardHeader({@@ -18,8 +25,9 @@ export function ConversationCardHeader({onTitleSave,executionStatus,sandboxStatus,+ isArchived,}: ConversationCardHeaderProps) {- const isArchived = isArchivedSandboxStatus(sandboxStatus);+ const archived = isArchived ?? isMissingSandboxStatus(sandboxStatus);return (<div className="flex items-center gap-2 flex-1 min-w-0 overflow-hidden">{executionStatus !== undefined && (@@ -27,6 +35,7 @@ export function ConversationCardHeader({<ConversationStatusDotexecutionStatus={executionStatus}sandboxStatus={sandboxStatus}+ isArchived={archived}showTooltip={false}/></div>@@ -35,7 +44,7 @@ export function ConversationCardHeader({title={title}titleMode={titleMode}onSave={onTitleSave}- isConversationArchived={isArchived}+ isConversationArchived={archived}/></div>);diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsxindex 62afd51fe9..866860698f 100644--- a/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsx+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-preview.tsx@@ -14,6 +14,7 @@ import { resolveAcpProviderIcon } from "#/constants/acp-providers";import AzureDevOpsLogo from "#/assets/branding/azure-devops-logo.svg?react";import { AgentBrandIcon } from "#/components/shared/agent-brand-icon";import { ConversationStatusDot } from "../conversation-status-dot";+import { isMissingSandboxStatus } from "#/utils/conversation-archive-status";import { getConversationTagLabel } from "./conversation-tag-display";import { getConversationTagIcon } from "./conversation-tag-icons";@@ -40,6 +41,13 @@ interface ConversationCardPreviewProps {* Sidebar card chips stay gated by the panel's Tags preference.*/tags?: Record<string, string> | null;+ /**+ * The row's effective archived state. Keeps the preview's status dot in+ * agreement with the "Archived" chip shown on the card being hovered. Leave+ * undefined to infer it from `sandboxStatus` (a missing, non-resumable+ * runtime).+ */+ isArchived?: boolean;}const providerIcon: Partial<Record<Provider, IconType>> = {@@ -114,9 +122,11 @@ export function ConversationCardPreview({acpServer = null,createdAt,tags = null,+ isArchived,}: ConversationCardPreviewProps) {const { t } = useTranslation("openhands");+ const effectiveArchived = isArchived ?? isMissingSandboxStatus(sandboxStatus);const repository = selectedRepository?.selected_repository ?? null;const branch = selectedRepository?.selected_branch ?? null;const provider = selectedRepository?.git_provider ?? null;@@ -142,6 +152,7 @@ export function ConversationCardPreview({<ConversationStatusDotexecutionStatus={executionStatus}sandboxStatus={sandboxStatus}+ isArchived={effectiveArchived}showTooltip={false}/></span>diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card.tsxindex 7e37e920a0..d3ae7b3e6a 100644--- a/src/components/features/conversation-panel/conversation-card/conversation-card.tsx+++ b/src/components/features/conversation-panel/conversation-card/conversation-card.tsx@@ -22,6 +22,7 @@ import { ConversationCardHeader } from "./conversation-card-header";import { ConversationCardActions } from "./conversation-card-actions";import { ConversationCardFooter } from "./conversation-card-footer";import { ConversationStatusBadges } from "./conversation-status-badges";+import { isMissingSandboxStatus } from "#/utils/conversation-archive-status";import { useDownloadConversation } from "#/hooks/use-download-conversation";interface ConversationCardProps {@@ -63,6 +64,12 @@ interface ConversationCardProps {tags?: Record<string, string> | null;/** Gates the tag-chip row; wired to the panel's "Tags" metadata toggle. */showTags?: boolean;+ /**+ * The row's effective archived state. Leave undefined to let the card infer+ * it from `sandboxStatus` (a missing, non-resumable runtime); pass it+ * explicitly when the panel also knows about an explicit archive so the+ * chip, dot, and dimmed title stay in agreement.+ */isArchived?: boolean;isPinned?: boolean;onTogglePin?: () => void;@@ -98,7 +105,7 @@ export function ConversationCard({acpModels = null,tags = null,showTags = false,- isArchived = false,+ isArchived,isPinned = false,onTogglePin,alwaysShowPinIcon = false,@@ -112,6 +119,11 @@ export function ConversationCard({const hasDisplayTags = displayTags.length > 0;const showTagChipRow = showTags && hasDisplayTags;+ // Effective archived state: an explicit prop (the panel passes the user's+ // archive plus the missing-runtime inference), or the missing-runtime+ // fallback for standalone callers that only pass `sandboxStatus`.+ const effectiveArchived = isArchived ?? isMissingSandboxStatus(sandboxStatus);+const onTitleSave = (newTitle: string) => {if (newTitle !== "" && newTitle !== title) {onChangeTitle?.(newTitle);@@ -249,7 +261,7 @@ export function ConversationCard({const showPersistentPinIcon = alwaysShowPinIcon && isPinned && !!onTogglePin;const shouldRenderFooter =showRepositoryMetadata ||- isArchived ||+ effectiveArchived ||(showLlmProfiles && (agentKind === "acp" || !!llmModel)) ||(showTagChipRow && displayTags.length > 0);@@ -273,8 +285,11 @@ export function ConversationCard({onTitleSave={onTitleSave}executionStatus={executionStatus}sandboxStatus={sandboxStatus}+ isArchived={effectiveArchived}/>- {sandboxStatus === "ERROR" && <ConversationStatusBadges />}+ {sandboxStatus === "ERROR" && !effectiveArchived && (+ <ConversationStatusBadges />+ )}</div><div@@ -384,7 +399,7 @@ export function ConversationCard({acpModels={acpModels}tags={tags}showTags={showTagChipRow}- isArchived={isArchived}+ isArchived={effectiveArchived}/>)}</div>diff --git a/src/components/features/conversation-panel/conversation-panel.tsx b/src/components/features/conversation-panel/conversation-panel.tsxindex 165541a989..e7e5d1248a 100644--- a/src/components/features/conversation-panel/conversation-panel.tsx+++ b/src/components/features/conversation-panel/conversation-panel.tsx@@ -61,6 +61,11 @@ import {import { useArchivedConversationsStore } from "#/stores/archived-conversations-store";import { usePinnedConversationsStore } from "#/stores/pinned-conversations-store";import { uniqueById } from "#/utils/unique-by-id";+import {+ isEffectivelyArchivedConversation,+ isMissingSandboxStatus,+} from "#/utils/conversation-archive-status";+import type { SandboxStatus } from "#/api/conversation-service/agent-server-conversation-service.types";interface ConversationPanelProps {onClose?: () => void;@@ -198,6 +203,21 @@ export function ConversationPanel({(state) => state.removeArchivedConversation,);+ // The one predicate every archived presentation reads: a row is effectively+ // archived when the user archived it, or when its runtime is missing and+ // non-resumable. List visibility, the "Archived" chip, the dimmed title, and+ // the status dot all derive from this so they cannot disagree.+ // (`sandbox_status: "ERROR"` is intentionally not archived.) Menu availability+ // is a separate concern and does not read this predicate alone.+ const isRowArchived = React.useCallback(+ (conversation: { id: string; sandbox_status?: SandboxStatus | null }) =>+ isEffectivelyArchivedConversation(+ conversation.sandbox_status,+ archivedIdSet.has(conversation.id),+ ),+ [archivedIdSet],+ );+const toggleGroupCollapsed = React.useCallback((groupId: string) => {setCollapsedGroupIds((prev) => {const next = new Set(prev);@@ -289,16 +309,17 @@ export function ConversationPanel({return pageById;}, [data]);- // Display collection: same loaded pages, with archived rows filtered out- // unless the user has opted into "Show archived".+ // Display collection: same loaded pages, with effectively-archived rows+ // (explicitly archived or missing-runtime) filtered out unless the user has+ // opted into "Show archived".const conversations = React.useMemo(() => {if (showArchivedConversations) {return allLoadedConversations;}return allLoadedConversations.filter(- (conversation) => !archivedIdSet.has(conversation.id),+ (conversation) => !isRowArchived(conversation),);- }, [allLoadedConversations, archivedIdSet, showArchivedConversations]);+ }, [allLoadedConversations, isRowArchived, showArchivedConversations]);// Facets derive from the unfiltered list so the automation-name rows in the// advanced-options modal don't vanish while a narrowing selection is active.@@ -855,7 +876,20 @@ export function ConversationPanel({options?: { inPinnedSection?: boolean },) => {const isPinned = pinnedIds.includes(conversation.id);- const isArchived = archivedIdSet.has(conversation.id);+ // Presentation: a row looks archived when the user archived it or its+ // runtime is missing and non-resumable. This single predicate drives list+ // visibility, the chip, the dot, and the dimmed title.+ const isArchived = isRowArchived(conversation);+ // Action availability is separate from presentation. "Unarchive" is only+ // meaningful when clearing the browser-local flag actually returns the row+ // to the unarchived state, so it is offered solely for an explicitly+ // archived row whose runtime is not missing. A missing, non-resumable+ // runtime cannot be restored from this menu, so such a row offers neither+ // "Archive" nor "Unarchive", even when a stored archive flag is set.+ const explicitlyArchived = archivedIdSet.has(conversation.id);+ const runtimeMissing = isMissingSandboxStatus(+ conversation.sandbox_status,+ );if (compact) {return (<CompactConversationRow@@ -885,6 +919,7 @@ export function ConversationPanel({acpModels={conversation.acp_available_models}tags={conversation.tags}showTags={showTagsMetadata}+ isArchived={isArchived}/>);}@@ -918,6 +953,7 @@ export function ConversationPanel({acpServer={conversation.acp_server}createdAt={conversation.created_at}tags={conversation.tags}+ isArchived={isArchived}/>}>@@ -936,8 +972,10 @@ export function ConversationPanel({onDelete={() =>handleDeleteProject(conversation.id, conversation.title ?? "")}- // Exactly one direction is offered per row, so the menu always- // reflects the conversation's current archived state.+ // Archive is offered until the row is effectively archived; the+ // reverse direction, "Unarchive", is offered only when the row is+ // explicitly archived and its runtime is not missing. A+ // missing-runtime row offers neither.onArchive={isArchived? undefined@@ -948,7 +986,7 @@ export function ConversationPanel({)}onUnarchive={- isArchived+ explicitlyArchived && !runtimeMissing? () => handleUnarchiveProject(conversation.id): undefined}@@ -1010,6 +1048,7 @@ export function ConversationPanel({handleEditTags,handleStopConversation,handleUnarchiveProject,+ isRowArchived,onClose,openContextMenuId,pinnedIds,diff --git a/src/components/features/conversation-panel/conversation-status-dot.tsx b/src/components/features/conversation-panel/conversation-status-dot.tsxindex a709cc6a08..f4705d7123 100644--- a/src/components/features/conversation-panel/conversation-status-dot.tsx+++ b/src/components/features/conversation-panel/conversation-status-dot.tsx@@ -3,6 +3,7 @@ import { FaArchive } from "react-icons/fa";import { ExecutionStatus } from "#/types/agent-server/core/base/common";import { SandboxStatus } from "#/api/conversation-service/agent-server-conversation-service.types";import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";+import { isMissingSandboxStatus } from "#/utils/conversation-archive-status";interface ConversationStatusDotProps {executionStatus: ExecutionStatus | null | undefined;@@ -19,6 +20,15 @@ interface ConversationStatusDotProps {* tooltip doesn't intercept the hover.*/showTooltip?: boolean;+ /**+ * The row's effective archived state (explicit archive or a missing+ * runtime). When true the dot shows the archive presentation even if the+ * sandbox/execution state would otherwise render as working, finished, or+ * errored, so the dot never disagrees with the "Archived" chip. Leave+ * undefined for the runtime-derived archived case, which is inferred from+ * `sandboxStatus`.+ */+ isArchived?: boolean;}type Visual = "check" | "working" | "active" | "paused" | "error" | "unknown";@@ -118,23 +128,25 @@ export function ConversationStatusDot({executionStatus,sandboxStatus,showTooltip = true,+ isArchived,}: ConversationStatusDotProps) {const { t } = useTranslation("openhands");- // sandbox_status === "MISSING" → show archived (gray) dot- // sandbox_status === "ERROR" → show error (red) dot- // Otherwise fall through to the execution-status visual.- const isArchived = sandboxStatus === "MISSING";+ // An archived row (explicit archive or missing runtime) downloads to a gray+ // archive icon so it matches the "Archived" chip. A missing sandbox is+ // inferred here for callers that only pass `sandboxStatus`; an unarchived+ // `ERROR` row keeps its red "Error" dot.+ const archived = isArchived ?? isMissingSandboxStatus(sandboxStatus);const effectiveVisual: Visual =- sandboxStatus === "ERROR"+ sandboxStatus === "ERROR" && !archived? "error"- : isArchived+ : archived? "paused": visualFor(executionStatus);const visual = effectiveVisual;- const label = t(labelKeyFor(visual, isArchived));- const indicator = isArchived ? (+ const label = t(labelKeyFor(visual, archived));+ const indicator = archived ? (<FaArchivedata-testid="conversation-status-archived"size={10}diff --git a/src/contexts/websocket-provider-wrapper.tsx b/src/contexts/websocket-provider-wrapper.tsxindex 0cdd49e098..e0b284ed6e 100644--- a/src/contexts/websocket-provider-wrapper.tsx+++ b/src/contexts/websocket-provider-wrapper.tsx@@ -6,7 +6,7 @@ import type { AppConversation } from "#/api/conversation-service/agent-server-coimport { useConversationStore } from "#/stores/conversation-store";import { useActiveBackend } from "#/contexts/active-backend-context";import { findPlannerConversationId } from "#/utils/plan-file";-import { isArchivedSandboxStatus } from "#/utils/conversation-archive-status";+import { isRuntimeUnavailableSandboxStatus } from "#/utils/conversation-archive-status";interface WebSocketProviderWrapperProps {children: React.ReactNode;@@ -94,11 +94,11 @@ export function WebSocketProviderWrapper({planningConversationIds.includes(subConversation.id),);- // A paused or archived runtime cannot accept a WebSocket connection. Its+ // A paused or unavailable runtime cannot accept a WebSocket connection. Its// persisted event history remains available through the backend API.const conversationUrl =conversation?.sandbox_status === "PAUSED" ||- isArchivedSandboxStatus(conversation?.sandbox_status)+ isRuntimeUnavailableSandboxStatus(conversation?.sandbox_status)? null: conversation?.conversation_url;diff --git a/src/hooks/use-is-archived-conversation.ts b/src/hooks/use-is-archived-conversation.tsindex 711bae427b..0f98f107eb 100644--- a/src/hooks/use-is-archived-conversation.ts+++ b/src/hooks/use-is-archived-conversation.ts@@ -1,7 +1,16 @@import { useActiveConversation } from "#/hooks/query/use-active-conversation";-import { isArchivedSandboxStatus } from "#/utils/conversation-archive-status";+import { isRuntimeUnavailableSandboxStatus } from "#/utils/conversation-archive-status";+/**+ * Whether the active conversation's runtime is unavailable, so runtime-backed+ * affordances (chat input, git/panel toggles) are read-only. Covers both a+ * missing (non-resumable) sandbox and an errored one.+ *+ * This is the read-only gate, not the archive predicate: use+ * `isEffectivelyArchivedConversation` for the archived presentation (list+ * visibility, the "Archived" chip, the dimmed title, and the status dot).+ */export function useIsArchivedConversation() {const { data: conversation } = useActiveConversation();- return isArchivedSandboxStatus(conversation?.sandbox_status);+ return isRuntimeUnavailableSandboxStatus(conversation?.sandbox_status);}diff --git a/src/utils/conversation-archive-status.ts b/src/utils/conversation-archive-status.tsindex f9903657b9..6ce618d1d6 100644--- a/src/utils/conversation-archive-status.ts+++ b/src/utils/conversation-archive-status.ts@@ -1,7 +1,48 @@import type { SandboxStatus } from "#/api/conversation-service/agent-server-conversation-service.types";-export function isArchivedSandboxStatus(+/**+ * A sandbox whose runtime is gone and cannot be resumed. Set for a Cloud+ * `sandbox_status: "MISSING"` and for a local runtime the adapter maps from+ * `runtime_info.runtime_status: "missing"` with `can_resume: false`.+ *+ * `ERROR` is deliberately excluded: an errored runtime keeps its red "Error"+ * indicator and is not treated as archived.+ */+export function isMissingSandboxStatus(+ sandboxStatus: SandboxStatus | null | undefined,+): boolean {+ return sandboxStatus === "MISSING";+}++/**+ * Whether the conversation's runtime is unavailable, so runtime-backed+ * affordances (WebSocket, chat input, git/panel toggles) are read-only and+ * its persisted history is the only thing left to read. Covers both a missing+ * (non-resumable) sandbox and an errored one.+ *+ * This is a runtime concern, not an archive concern: do not use it to decide+ * list visibility, the "Archived" chip, or the archive/unarchive direction.+ */+export function isRuntimeUnavailableSandboxStatus(sandboxStatus: SandboxStatus | null | undefined,): boolean {return sandboxStatus === "MISSING" || sandboxStatus === "ERROR";}++/**+ * The single "effective archived" predicate: a conversation is archived when+ * the user explicitly archived it, or when its runtime is missing and+ * non-resumable. Drives the archived presentation (list visibility, the+ * "Archived" chip, the dimmed title, and the status dot) so those never+ * disagree.+ *+ * This is presentation only. Menu availability is a separate concern: a+ * missing, non-resumable runtime cannot be restored from the menu, so such a+ * row offers neither "Archive" nor "Unarchive" even when this returns true.+ */+export function isEffectivelyArchivedConversation(+ sandboxStatus: SandboxStatus | null | undefined,+ explicitlyArchived: boolean,+): boolean {+ return explicitlyArchived || isMissingSandboxStatus(sandboxStatus);+}