HWChatHWChat is a local-first coding agent for VS Code with a DeepSeek / OpenAI-compatible backend. It ships a compact chat surface and settings page, native streaming tool calling, local skills, file attachments, permission presets, plan-tracking task lists with archived snapshots, terminal commands labelled with where they run and which shell to use, archived history and crash-resilient chunked storage. The chat lives in the VS Code secondary sidebar, so it never takes over an editor tab.
What's new in 0.4.14Project decision record: earlier decisions stop getting lostThe diagnosis was right, and it is structural: task-tree memory lives in the extension's storage per conversation — nothing is stored in the project. Even inside one conversation it is truncated (40 finished tasks, 100 chars per line, only 3 constraints), and "continue in a new chat" carries a ≤10,000-character digest. So once the conversation grows or you start a new one, earlier decisions are gone — and the same thing gets reworked. Now:
One row in Settings under Permissions & privacy: maintain automatically / ask before each write / off, machine-scoped (a cloned repo cannot turn it on for you). Verified: 1,316 unit tests + 79 guard scripts green (at the time of 0.4.14). What's new in 0.4.15The decision record, finished properly: the host records work itself, and the model is told from turn one0.4.14 only created the skeleton and relied on the model calling the tool. Three holes closed here:
Verified: 1,318 unit tests + 79 guard scripts green; the guard was reverse-checked by removing the teardown call. What's new in 0.4.14Project decision recordThe project badge showed a project name for a brand-new conversation (reported on Windows)After installing 0.4.12 on Windows, a new conversation showed
Verified: 1,307 unit tests + 78 guard scripts green, including the new What's new in 0.4.12
This release fixes two kinds of "it just stopped": a healthy run aborting itself, and a conversation that grows long with no warning and no way out. Request budget: fold the oldest tool outputs when overPer your choice (A): when over budget, fold the oldest tool outputs first, keeping conclusions and the most recent turns.
Conversation length gauge + "Continue in a new chat" (was 0.4.14)The panel only ever showed a cumulative billed token count (that 1.03M figure). That is not context length — it tells you nothing about how close the conversation is to not fitting.
Verified at that point: 1,299 unit tests + 77 guard scripts green, including three real Chromium states (9% / 78% / 148%) where the over state actually clicks the button. A dropped connection (
|
| State | Indicator |
|---|---|
| Waiting to run | green hollow circle |
| In progress | green bouncing ellipsis |
| Completed | solid green circle with a white check |
All three marks are inline SVG icons, not font characters: the shape and weight are identical on macOS and Windows, the colour follows the theme, and nothing depends on whether the system font happens to contain the glyph or what its metrics are. The disclosure arrows work the same way (one masked chevron rotated 90° instead of a ▸ / ▾ character). A small set of emoji in agent output (🔔 📌 💡 🚀 🔍 ⚠ ✅ ❌ 📝) is replaced with the same icon set, because system emoji are coloured and glossy and cannot be flattened with CSS; the swap happens on rendered text nodes, skips <pre> / <code>, and leaves unlisted emoji alone.
Click the title to collapse or expand the list, the same way as the task tree. A new list opens the panel automatically — the collapsed state is only remembered within one list, so a list that was collapsed earlier never makes a new task look like it never started. The agent keeps exactly one step in progress, updates the list after each step, and leaves the finished list in place as a record of what happened. The list is stored with the conversation, so it survives reloading the window; a single-step request never creates one. It is a tool (update_todos) that needs no permission, because it changes no files and runs no commands.
Two things the task list never contains
A push and a version bump are never task-list items. Both are asked about separately once the work is finished and verified, and happen only after you say yes.
This is not tidiness for its own sake. The moment a list reads 6. Commit and push, clicking Continue shows you those steps and approves the work they describe — so a push you never asked for gets authorised by the list itself. And that item is usually not the agent smuggling something in; it is the plausible expansion "while I am committing, I may as well push", which is exactly the kind of line nobody re-reads.
Two layers are needed, because either one alone leaks: a prompt rule that keeps these steps out when the work is broken down, and a filter before the list is stored that removes them if the model writes them anyway — plus a note in the tool result telling it to ask you afterwards.
The filter is deliberately narrow and only matches real repository actions: git push, "push to remote / origin / branch", "push the code to origin", "bump the version to 0.2.4", npm version patch, "bump to 0.2.4". "Implement message push", "a toggle for push notifications" and "send a push notification to the device" are ordinary feature work, and "package as version 0.2.3" or "fix the version label" are a build step and a copy change — none of those are removed. If every item in a list is one of the excluded kinds, the list stays as it was rather than being emptied.
After an interruption: continue or cancel
When a run is cut short (process killed, stop pressed) or the model finishes without ticking the last boxes, two buttons appear at the far right of the list header: Continue and Cancel task.
- Continue picks the work up from where it stopped instead of redoing finished steps. Context is rebuilt from the archive, so the model sees the list it wrote and every tool result up to the interruption. The button only appears while unticked items remain. It clears the interrupted flag before starting the run, then re-reads the archive afterwards: if the run never actually started (a denied approval, a blocked send, an error before dispatch), the flag is put back so the list cannot get stuck half-done with no way to resume.
- Cancel task clears the list without archiving it and without leaving a capsule — it means "stop keeping this". If the run is still going, it is stopped first, so the end-of-run bookkeeping cannot write the cleared list back.
The header is split into fixed-width sections (title / state / actions), each left-aligned inside its own section, so a longer or shorter state text can no longer push the title around. The task-tree header has only the title and the node count. To keep the state section at a fixed width, the English state text was also shortened from interrupted, can be resumed to interrupted — the buttons already say it.
Archived capsules
Once every step is completed, the list is archived immediately — not when the run ends: the moment the last item is ticked, it leaves the composer area, the task-list disclosure disappears, and a solid-colour rounded rectangle takes its place above the input box, left-aligned. That removes the "finished but still taking up space" case: the model usually keeps writing its summary after the last tick, and if the process is killed or the window closed in between, the end-of-run bookkeeping never runs and a finished 6/6 list would sit there forever (reading a conversation also archives such leftovers).
- A capsule holds no icon and no text, and hovering it shows nothing — the colour and the left-to-right order are the whole message. Screen readers still get "Archived task list, N/M done".
- The border shows the state: the archive you have open gets a red border, and the capsule under the pointer gets a light red border so you can tell which one you are about to click (hovering never changes the capsule's own solid colour). The border is painted inside the capsule, so nothing shifts or resizes when it appears.
- Click a capsule to expand that snapshot (title reads "Archived task list", the summary carries the archive time, the border turns dashed); click again to collapse.
- Only one panel is expanded at a time: opening the snapshot closes and locks the task tree and the list that is still running (their titles dim, and clicking them says to collapse the archive first), so you are only ever looking at one list. Collapsing the snapshot — via its own title bar, or by clicking the same capsule again — unlocks them and restores whatever you had open before. If the right side of the panel is ever clipped or cut off, run
HWChat: Copy layout reportfrom the Command Palette (it includes acapsuleBarsection): the panel measures its own webview viewport width, documentscrollWidth, and the rects plus horizontal overflow of the sidebar, chat pane, message list and composer, then copies those numbers together with a list of out-of-bounds elements — enough to tell our CSS apart from a webview whose width is out of sync with the visible area. The chat pane also has a hard horizontal boundary (.app-shellusesoverflow-x: clip), so no content can widen the document, spin up a horizontal scrollbar and push the right side out of the window — but that boundary only works together with a pinned column width:.chat-paneand.message-areadeclaregrid-template-columns: minmax(0, 1fr), because an implicitautocolumn gets sized to the widest child's max-content (measured: in an 870px viewport with 40 archive capsules that column grew to 1387px and 514px on the right became permanently unreachable — the same root cause for both "dragging the capsule row to the end still leaves the last capsule clipped" and "the conversation is cut off") — on macOS overlay scrollbars stay hidden until you scroll, which makes that look like "the right side is cut off and there is no scrollbar". The panel area also has a height ceiling (28vh, and never more than 260px — far smaller than the earlier 44vh/360px) and scrolls internally (the scrollbar is always visible, so both the wheel and dragging work), so it can neither push the composer out of the window nor squeeze the conversation above it out of sight (very short windows give it one more step down). While a snapshot is open the other two panels collapse to their title bars, and the pane gets a taller ceiling so more rows fit at once. - A conversation can hold several archives; each new one appears to the right of the previous one. Colours are one continuous ramp from light blue
#7cbef0to deep blue#1e4fd8, sampled evenly by position, so the step between any two neighbours is the same size — it reads as a gradient rather than a few jump-cuts, getting deeper towards the right. - Capsules never wrap and keep a fixed 3:1 width-to-height ratio, 10.67px tall (32px wide). When the row is too narrow it scrolls horizontally with no scrollbar at all (a 6px track is nearly half the capsule's own height — it both obscured the row and pulled the eye): scroll it with the mouse wheel over the row, or hold the mouse button and drag (the cursor is
grab, turning intograbbingwhile dragging; touch screens use the platform's native momentum scrolling). Once the row is scrolled to an end, the wheel goes back to scrolling the page vertically. Capsule size stays constant. A newly added archive scrolls itself into view once, while re-renders (expanding or collapsing a snapshot) leave your scroll position alone. The corner radius is about 3px, and each capsule remains a rounded rectangle, never a pill. - Archives are not capped: the capsule rail scrolls horizontally, so however many lists a conversation finishes, every one of them stays (the old 12-capsule limit silently dropped the earliest archives in a long-running conversation). Each archive itself is bounded at 40 items, so storage grows with the number of task lists you actually completed. Lists that ended with unfinished items are not archived — see "Unfinished lists" below.
- Archives are persisted with the conversation (
todoArchivesin the manifest), so they survive a reload; malformed entries on disk are dropped at load time without affecting the conversation.
Unfinished lists (interrupted / not finished)
When a run ends with items still open, the list does not become a capsule: it stays in the panel and the in_progress item is downgraded to waiting (hollow green circle) so the bouncing animation stops — nothing is advancing it, so it must not pretend to be running. The note in the disclosure header depends on how the run ended:
- interrupted, can be resumed — you pressed stop, the request failed, or the window/process went away. The work was cut off mid-flight.
- not finished, can be resumed — the agent loop finished normally but the model forgot to tick the last item. That is not an interruption, so it is labelled in a neutral colour instead of the warning amber that would make it look cut off. The engine deliberately does not tick it for the model: the list is the model's own statement of what is done, and auto-ticking would be fabricating progress. Prevention lives in the system prompt instead — before ending a turn the model must re-read the list and, for any item whose work is finished (including the very last one), call
update_todosonce more to mark it completed.
Either way the follow-up is the same:
- Carry on: ask the agent to continue. It reuses the same list, sets the current item back to
in_progress, and once everything is completed the list is archived as usual. This resume instruction binds to that list exactly once: the panel scopes the turn to the list's unticked items instead of treating "continue the task list" as the task itself, so an unrelated request made meanwhile is queued (shown as waiting in the task tree) rather than merged into the running turn. When every item is already ticked, or there is no list at all, it does not apply. Continue approves that you keep doing what you already asked for — not every line of the list. The list is the agent's plan, not a record of what you approved; if it added something you never asked for (a push, a version bump), that step needs its own yes. - Start something else: just ask for the new task. A genuinely new list replaces the old one, but replacing a list that still has progress is refused: if the submitted list drops items the existing list already marks completed,
update_todosreturns an error, nothing is written, and the model is told to copy the existing items verbatim and only re-plan the unfinished part. (Without that guard an agent that “continues” often re-derives the plan from the last few turns and quietly throws away six verified steps — this really happened.) The guard opens only when you explicitly ask to re-plan in that turn (“replan the list”, “throw the old list away”), or when the old list is fully completed (it is archived anyway) or had no completed items to lose. The rejected call is not a tool error the model should work around: the tool tells it exactly what to do next. - The model now sees the list it is resuming:
update_todosresults aretoolmessages and are filtered out of the request, and the list itself only lived in the conversation summary — so “continue the unfinished items” arrived with no list attached. The request now injects a<task_list>block into the system message with[x]/[>]/[ ]marks, a count of what is left and an explicitNext item to work on: #N. A fully completed or absent list injects nothing.
Both flags are persisted with the conversation (todosIncomplete / todosInterrupted in the manifest) and are mutually exclusive: one list only ever carries one of them, and both are cleared when a new list arrives or the list is archived. Older saves without these fields are treated as unmarked.
Concurrent conversations
Every conversation runs its own agent thread; they do not block each other:
You can start a new chat or open another history entry while a reply is streaming — the conversation you leave keeps running in the background and is marked with a blue "running" dot in the history list.
What the new-chat button does: if the current conversation has content, it creates a new one (a card appears in the sidebar immediately and the right pane switches to its empty chat); if the current one is already empty (0 messages), nothing is created — focus just returns to that empty chat. Otherwise repeated clicks pile up a stack of identical "New chat · empty" cards. Empty conversations that already piled up are collapsed to the newest one by the periodic cleanup (5 minute grace period; an empty conversation has nothing to lose).
Stop only stops the thread you are looking at; archive and delete only guard their own conversation.
Switching conversations never carries content across: the message list you see is always exactly the conversation you selected, and a switch is never deferred.
- Two independent causes were fixed. First, the page-merge helper kept locally-streaming messages while the page push only carries the newest 80, and it did not know which conversation was being viewed — so the reply still streaming in the conversation you left was appended to the new one and stayed there (its completion event carries the old conversation id and gets filtered out, so nothing ever updated or removed it). Optimistic bubbles could follow the same way, and a status-only update used to rewrite the sidebar preview with an older message.
- Second, redrawing the list is deferred while you have text selected or are interacting with a message (so a streaming re-render cannot destroy your selection). A conversation switch is not a re-render any more: it forces a full redraw and clears those interaction guards. Before the fix, selecting text in a reply and then clicking another conversation left the new title over the old messages, and a message arriving in the new conversation was appended to the old list — the two conversations visible in one list.
- The panel now remembers which conversation the list actually shows, refuses to append into another conversation's list, and never claims "already up to date" when it is not. Loading older messages is checked on both sides too.
Model / mode / skills stay locked only while that conversation itself is busy, never because some other conversation is running. Permission preset, max steps and reasoning depth deliberately stay editable during a run (they apply to the next send); see the per-conversation settings below.
When a background thread finishes, only the history list is refreshed, so your scroll position in the current conversation is preserved.
The history list is ordered by creation time (newest first), not by last activity. Sending a message in an old conversation no longer bumps it to the top, so every entry keeps its place and you do not have to re-scan the list after each reply. Pinned conversations still float to the top and archived ones still sink to the bottom.
Copying a message that has images copies the text and the image: click Copy on the message and the clipboard receives
text/plainplusimage/png; pasting into the composer (⌘/Ctrl + V) puts the text in the input and the image in as a pending attachment — no need to save the picture first.- It copies the original image, not the 160×120 thumbnail the panel shows; jpg/webp are converted to PNG first (the async clipboard API only accepts PNG).
- A clipboard holds one image per MIME type, so a message with several images brings the first one, with a note saying so.
- Hovering the Copy button starts prefetching the original and converting it to PNG, so the click itself is a single write — a large screenshot will not fall back to text-only because the user gesture expired.
- Keyboard works too: Tab to the image and press Enter to open it, or Tab to “Add to composer” and press Enter/Space to add it — the two entries never steal each other's keys.
- If the environment refuses the image write (old engine, or the attachment was evicted from memory) the text is still copied and you are told explicitly that only the text made it — never a silent half-copy.
Images and attachments you already sent can be moved back into the composer: drag an image from a message onto the composer (it lights up with an accent outline; release and it becomes a pending attachment), or click “Add to composer” in the image's top-right corner. Both routes take the same path — the webview only sends the attachment identifier, and the extension resolves the content from memory by
id(images keep theirdataBase64); if that entry has already been evicted from the cache it is re-read from disk through the exact same reader as “attach files” (same size limits, sensitive-file rules and binary detection). Text attachments can be dragged too, and files can be dropped straight in from Finder or the Explorer.- The copy is a separate attachment (it deliberately does not inherit the original's internal handle), so dragging twice gives you two — no need to scroll back for a second copy. The limits match “attach files”: at most 20 items and the same total-size ceiling.
Queued messages are edited in the message bubble and deleted from the task tree.
- The edit entry lives in the message bubble (a Not run yet badge plus Edit this message): it opens a floating editor (its own layer, centred over the panel) sized to the message, so a long message no longer has to be read one line at a time in the task tree.
⌘/Ctrl + Entersaves;Escor clicking the backdrop cancels. The overlay lives outside the message list, so streaming re-renders cannot destroy it — no more "the click did nothing", "the caret jumped to the start" or "my IME composition was interrupted". - The agent waits for you: opening the editor puts a gate on the task queue, so when the agent reaches that message it pauses (the overlay header shows "The agent is waiting for you" with a pulsing dot). Save and it immediately reads the new text and continues; cancel and it continues with the original. The wait is capped at 5 minutes so a forgotten editor can never wedge the run.
- While the message is still in the queue (including the brief
routingmoment when the relation classifier is running), saving rewrites that very message: the queue holds the request, so the agent simply reads the new text next round — no cancel-and-resend, no duplicate message, and the task-tree row and the stored user message change together, so the two can never disagree. Images and other attachments survive the edit. - The message list is never re-rendered while you edit: streaming output and task-tree updates are recorded and applied once you leave the editor, otherwise the editor would be rebuilt and the caret, selection and any in-progress IME composition would be lost.
- Deleting (the button on the task-tree row) removes the queued request plus its pending placeholder reply from disk, so no orphan “queued but never ran” message is left behind. The node stays in the task tree marked cancelled — the tree is a timeline of what happened in this run, and erasing a node would pretend you never sent it.
- A node that is currently executing offers no edit entry at all. The agent has already read that request and is running it, and the backend cannot change it (
editPendingalways returns false); the old entry therefore fell through to "send the edited text as a new message", which queued the same work a second time. To change direction, add a line in the composer (it merges into the current branch as related guidance) or stop the run first. - Once a node has finished, its task-tree row offers Edit: history is history and delete is refused (with a one-line reason), but the editor opens in the message bubble titled Edit and send again, and saving sends the edited text as a new message — you can re-say what you meant, but the past is not rewritten. Whether something can be changed in place comes from whether the queue still holds it, not from a status guess.
- The edit entry lives in the message bubble (a Not run yet badge plus Edit this message): it opens a floating editor (its own layer, centred over the panel) sized to the message, so a long message no longer has to be read one line at a time in the task tree.
"Internet reference" toggle (toolbar, where the model-refresh button used to be): one click turns this conversation into research first, then act.
- With it on, the agent follows three phases written into the system prompt and re-applied on every request (including "continue"): ① research —
search_github_reposfor related mature open-source projects (sorted by stars, with license and last update),search_webfor concepts and doc entry points, thenfetch_urlto read the primary source (official docs, spec, reference implementation) and record "URL + one-line conclusion + how this project differs"; ② align the plan — fold the findings into the task list (item one is the research itself) and reorder or replace the remaining items so they follow what was learned; ③ implement — build on what you read and say in one sentence where you deviate from a source. - Three hard rules go with it: never state a conclusion without the URL you got it from, never treat a search snippet as evidence (a snippet is only a lead to the primary source), and when nothing usable turns up, say so plainly and offer 2-3 candidate approaches with their costs instead of disguising a guess as research. Code is only borrowed after checking its license, version and premises.
- The three web tools only appear in the tool list while the toggle is on (with it off the model cannot even see them):
search_github_repos,search_web(whose output is explicitly labelled as leads) andfetch_url.fetch_urlaccepts http/https only and refuses local and intranet hosts (localhost,127.x,10.x,192.168.x,172.16-31.x,169.254.x,*.local, …), so a model cannot accidentally probe your dev server. - The toggle itself is the approval, so these three never prompt per call: one research pass easily makes a dozen calls, and confirming each one turns the feature into click-work. Consent for going online is given once, per conversation, by flipping the switch (off by default); the genuinely risky direction — reaching your machine or local network — is blocked separately by the address checks. If the toggle is off and the model still calls one of these names, it gets an explicit "Internet reference is off, turn on the globe toggle first" instead of a vague "Tool not allowed".
- The toggle belongs to this conversation: turning it on in A does not send B to the web, it is stored with the conversation, and it survives a window reload. It defaults to off. It can be flipped while a task runs — like the other three controls, the change applies from your next message (the running turn uses the snapshot taken when it started).
fetch_urlreturns the article, not a soup of tags: HTML pages go throughdefuddle(MIT, 9.8k★, the extraction engine behind Obsidian Web Clipper) and come back as clean Markdown — nav bars, sidebars, breadcrumbs, cookie banners and footers are dropped while headings, lists, links, code blocks and tables survive. Measured: an MDN page of 327 KB HTML → 4057 characters of Markdown. If the extracted body is under 200 characters (JSON-ish fragments, very thin pages) it falls back to the full-page text; it never returns nothing. The tool output states which path was taken ("Extracted article: Markdown…" vs "Whole page text (no article recognised, fell back)") so the model knows what it is reading.- Open-source licence compliance:
defuddleand 18 other third-party libraries are bundled intoextension.jsand redistributed, and MIT / BSD-2 / ISC all require shipping the copyright notice and licence text. So the repo carriesTHIRD-PARTY-NOTICES.md, generated byscripts/third-party-notices.mjsfrom esbuild's metafile (only packages actually reachable from the entry point) and published inside the VSIX. A package with no licence file makes the build fail rather than silently shipping uncredited code. The list currently covers 19 packages:defuddle(MIT),@mixmark-io/domino(BSD-2),temml,htmlparser2,@xmldom/xmldom,@acemir/cssom,linkedom(ISC),mathml-to-latex,entities(BSD-2),css-select(BSD-2),domutils(BSD-2),css-what(BSD-2),turndown,domhandler(BSD-2),dom-serializer,nth-check(BSD-2),domelementtype(BSD-2),uhyphen(ISC),boolbase(ISC).npm run packageis now three steps — compile → refresh notices → package — so the list cannot go stale.
- With it on, the agent follows three phases written into the system prompt and re-applied on every request (including "continue"): ① research —
Every message you send carries an execution-status badge, four colours that answer "which one never ran" at a glance: Not run yet (amber, dashed — still queued), Running (blue, pulsing dot — the agent is executing this one), Done (green, solid — finished, failed or stopped all count), Skipped (grey, dashed — the run ended without the agent ever reading it, i.e. the ignored one). Hover a badge for a plain-language explanation. When a run queues several messages and you stop and continue, these colours are how you reconcile what was actually handled instead of relying on memory.
- The status lives on the message itself (
executionStatus), not just in the task tree, so it survives the run ending, switching conversations and even restarting VS Code. Messages from older versions have no such field and show no badge — when the status is unknown we do not guess, because a wrong "Done" would make you believe work happened. - "Skipped" exists on purpose: when a run ends, the task tree marks its own nodes with the finish status, so the tree alone cannot separate "finished" from "queued but never ran". The badge is decided by whether the agent ever actually read the message (
activated). Anything left unsettled by an abnormal exit is resolved on the next startup: running → Done, pending → Skipped.
- The status lives on the message itself (
Long messages you send are collapsed by default: past ~480 characters or 12 lines (either one triggers it), your message is clamped to a few lines with a soft fade and a Show full message button; short messages are untouched and get no button. Collapsing only toggles a CSS class — the markdown, tables, code blocks and file chips inside are never rebuilt, so expanding keeps your selection and scroll position, and an expanded message stays expanded when later messages re-render the list.
Your unsent text in the composer belongs to the conversation you typed it in. Switching conversations saves the draft and restores the one belonging to the conversation you open — text you typed in one chat can no longer be sent to another by mistake.
Per-conversation settings
- It stops and asks when there is a real decision point. When two or more approaches are viable with materially different results, when the requirement leaves a genuine choice open, when the change is hard to undo, or when the deliverable can only be judged by looking at it (a UI, a flow, a generated artifact) and the layout/behaviour was never specified, the agent calls
ask_user_choiceand shows a card. Every option must state three things: what it will deliver, how far it goes (including what it deliberately leaves out and where it is still rough), and what it costs (time, blast radius, risk, follow-up maintenance). While the card is up the agent waits — it will not pick one and carry on behind your back.- It does not turn into “asking every step” either: it stays silent when there is only one reasonable way, when the answer is already in the code or the conversation, for reversible cosmetic choices, when you already decided, or for routine steps of a plan you approved.
- After you pick, it follows that option and will not switch on its own; if it turns out the option cannot deliver what you expected, it explains why and asks again.
- The card can be collapsed (the “Collapse / Expand” control on its title row): collapsed it keeps only the question, so you can scroll the conversation first and decide afterwards.
- None of the options fit? You do not have to pick one — just type your own approach in the composer and send it; that sentence becomes the answer. It follows your approach, does not map it onto one of its options, and does not add scope you did not ask for.
- Every line of the execution log says what it did: command steps read
`npm test` → exit 0 · 12.4sinstead of a bare “Command exit code 0”, and the summary redacts credentials (Authorization: Bearer …,?token=…) while keeping non-sensitive parameters so the command is still recognisable. - A skill's trigger words are a separate field, so description truncation can no longer eat them. Descriptions are parsed into three parts: summary / when to use (
USE FOR:Use when:) / triggers (Triggers:, or an explicittriggers:frontmatter field). Triggers are not subject to the 240-character summary cap and are rendered verbatim in the routing table (- id | name | summary | 适用:… | 触发词:…), so it no longer matters where in the description you put them; each skill in the panel takes a single summary line (ellipsis beyond that), and hovering shows the full summary, when-to-use and triggers — with 38 skills that cuts the list from 7 screens to about 4.7. The summary itself is capped at 180 characters, the “when to use” at 200 and the triggers at 160, with an explicit ellipsis when something is clipped.
Mode, model, permission preset, max steps and reasoning effort belong to the conversation itself (src/core/conversationControls.ts, src/core/modes.ts).
- A new conversation always starts at “Ask every time” / 24 steps / “Default (model)”, regardless of older values in
settings.json. Earlier versions wrote the panel's choice into global settings, so leftovers such ashwchat.permissionPreset: autopilotandhwchat.agentMaxSteps: 0made every new conversation auto-execute with no step cap. Those keys are still registered (so no "unknown configuration" warning) but marked deprecated and never read;HWChat: Show permission scopestill prints the declared values so you can reconcile them. - Switching conversation A to "Full access" does not loosen the permissions of conversation B running in the background, and changing B's step limit does not truncate A's next round.
- Changes made in the panel are written back to the current conversation only — never to global configuration.
- Permission preset, max steps and reasoning depth can all be switched while a task is running (like Copilot), and all three take effect from the next message you send — not in the round already in flight. A run snapshots its settings when it starts and every tool call reads that snapshot, so switching mid-run never rewrites the current turn into a half-old / half-new configuration; the new values are stored on the conversation and the first message after the task finishes uses them. The UI says so explicitly (each control shows “applies to the next send” while running).
- Widening to Autopilot / Full access still asks for confirmation before it is stored.
- Invalid stored values (misspelled preset, string step limit, non-string project root) are dropped on load and fall back to defaults instead of being carried into a run.
git and project scope
HWChat never commits on its own. git write operations (add, commit, push, tag, reset, clean, merge, rebase, checkout, restore, stash) are allowed only when:
- the user explicitly asked to commit, push or tag in the current conversation — including a follow-up message sent while the run is already going (negations such as "don't commit yet" do not count), or
- an enabled skill rule requires committing after finishing a task — this counts as an explicit request.
The system prompt states the same rule, but the boundary is enforced at runtime: ToolExecutor parses every command for git subcommands and refuses unauthorized ones with an explanation, and bridged VS Code tools (such as run_in_terminal) are checked through their JSON arguments so the rule cannot be bypassed by switching channels. Read-only inspection (status, diff, log, show) is always allowed.
Commits stay inside the project this conversation belongs to:
- Each conversation binds a project root (
projectRoot) on its first file write or on an explicitcwd. Relative paths, the default commandcwdand newly created files belong to that project instead of "the first root of the multi-root workspace". - Before a git write, the real repository root is read with
git rev-parse --show-topleveland must match the project root. A repository that also contains another workspace project is refused too, because onegit add -Awould sweep that project's changes in. - While the project root is undetermined, git writes only accept an explicit
cwd; the "default lands on the first root" behavior is never treated as project ownership.
Version numbers: asked after the task, never bumped on its own
HWChat does not bump versions on its own either. The version number is the user's decision, not a finishing step:
- It must not edit the
versionfield ofpackage.json/package-lock.json/manifest.jsonand similar manifests, and must not runnpm version/yarn version/cargo set-version/standard-versionor create git tags. - It asks only when asking is due, and only once:
- short tasks — after every problem mentioned in the conversation is finished and verified;
- long tasks — at a clear phase boundary, or after the whole task is done;
- never mid-task, and never bundled into the middle of an unfinished step.
- Until the user says yes, versions and git history stay untouched and the remaining work continues. An explicit request ("bump to 0.2.3") or an enabled skill rule counts as permission.
The same rule is enforced at runtime (src/agent/releasePolicy.ts): when a write touches a version manifest, the project's own version field is compared and a change is refused with an instruction to ask the user first; npm version-style commands are refused as well, and bridged VS Code tool arguments are checked so switching channels does not bypass it. Read-only queries (npm --version, git tag -l) remain allowed.
Only project-level version numbers count: dependency versions inside package-lock.json, and version entries in a Cargo.toml dependency table, are not treated as bumps. When a manifest cannot be parsed the write is not blocked — refusing to break a normal file repair matters more than catching that edge.
Skills
HWChat scans these local formats:
.hwchat/skills/*.md.agents/skills/**/SKILL.md.claude/skills/**/SKILL.md- the user skill folder in VS Code global storage
~/.copilot/skills/**/SKILL.md
The star button opens the "skills used in this conversation" panel. Its ticks are wired straight to the local skill quick-launch extension: when that extension is installed, the global tick list it maintains (active in ~/.copilot/.skill-quick-launch.json) is each new conversation's starting selection. After that, ticking or unticking in the chat panel affects only the current conversation and is never written back to that list — a temporary opt-out for one task should not silently change the default for every future conversation. To change the default, tick in the quick-launch panel. Tick or no tick, "selected" does not mean "loaded every turn": in route mode the agent first sees a lightweight routing table and only reads the full text through load_skill on a match; chat mode preloads on a text match. Each reply lists only the skills actually read in that turn, and the last-used timestamp is written back to the quick-launch extension (timestamp only, never the ticks). Installing, uninstalling, enabling or disabling that extension updates the panel immediately (via extensions.onDidChange) — no window reload — and a tick change on its side is picked up too.
Without the quick-launch extension the star button shows only an install hint (with a "Not installed" badge) and an "Open extension page" button — no skill list at all: with no source for the defaults, the panel's one job is to send you to install it. The button opens the extension page inside VS Code via the built-in extension.open command (so you can tick right after installing), falls back to workbench.extensions.search, and only then opens the Marketplace page through vscode.env.openExternal. Uninstalling that extension does not delete .skill-quick-launch.json, so HWChat stops reading it once the extension is gone — otherwise those 30-odd stale active entries would mark every skill as "enabled by default" and pre-tick it, which looks exactly like a botched uninstall. The skills themselves are still discovered under ~/.copilot/skills/ (that is Copilot's skill directory and does not come and go with the extension); they just stop being steered by an orphaned state file.
Skills from other sources (.hwchat/skills, .agents/skills, .claude/skills, the extension's own user skill folder) are also selected per conversation; always-mode skills join the system context directly. Simple YAML frontmatter with name and description is supported.
Permissions and privacy
- API keys live in VS Code
SecretStorage— never in the project, the conversation, or the VSIX. - Before the first send, the data flow is shown explicitly and must be accepted.
- Four permission presets (no per-item custom combination), with a boundary table in settings and the same wording in the composer dropdown:
| Preset | Read | Write | Read-only commands | Regular commands | Dangerous commands | Sensitive files |
|---|---|---|---|---|---|---|
| Ask every time | Ask | Ask | Ask | Ask | Deny outright | Blocked |
| Ask on risky actions | Allow | Allow (in workspace) | Allow | Allow | Ask | Blocked |
| Autopilot | Allow | Allow (in workspace) | Allow | Allow | Allow | Blocked |
| Full access | Allow | Allow (in workspace) | Allow | Allow | Allow | Ask |
- Read-only commands are side-effect-free (
ls,git status,grep…); regular commands are everyday operations (install, build, commit…); dangerous commands cover privilege escalation, destructive deletion, disk wiping, pushes to a remote and piping remote scripts into a shell. git pushis always a dangerous command (not only a forced push):Ask every timedenies it outright,Ask on risky actionsconfirms it,Autopilot/Full accessrun it unattended. The check skips git's global options, sogit -C . push,git --no-pager push,git -c k=v pushandbash -c "git push"are caught just likegit push.git pull/git fetch/git cloneare not in that tier: they are regular commands and run without asking fromAsk on risky actionsupwards (the default preset still asks).- Commands you must run always say which machine they run on: every command block header shows the location (local terminal / server terminal / custom) plus the exact shell. When the model omits it, the header says Location: not specified and tells you to check first — it is never silently omitted.
- A blocked command now tells you what to do next: when path isolation refuses a location, the message says to change the path instead of retrying the same one and names the fix (keep the file inside the workspace, for example a
tmp/folder at the workspace root, or use the file tools). A policy denial is deterministic: the same command in another spelling is still denied. - Pattern arguments like
--excludeare not file access:tar --exclude '.env',grep --exclude-dir '.ssh'andfind -name '.env'are no longer blocked by the sensitive-file guard, while file-reading options (--exclude-from,-f) are still validated. - The git write gate no longer requires you to name the operation for
clone/init/fetch/pull. These never commit someone else's changes and never rewrite published history, so they simply follow the preset (Ask every timeasks once;Ask on risky actionsand above run them).commit/push/merge/rebase/reset/cleanstill require you to have asked for it in this turn ("commit", "push", "merge main" all count) or an enabled skill rule to require it. - Clicking approve is authorization. The confirmation card shows the full command; vetoing it afterwards with a keyword match is what produced "I clicked confirm and it still failed". The git gate now honours that approval.
clone/initskip the repository-ownership checks. Both create a repository that does not exist yet, so "no repository found above" and "project not bound" are self-contradictory. A single-folder workspace also no longer needs a bound project —.has only one meaning; multi-root workspaces still require an explicitcwdso a commit cannot land in the wrong project.- Outside the workspace is still a hard boundary:
git clone /absolute/path/elsewherestays blocked. Cloning into the workspace (relative path or an absolute path inside it) is unaffected. - Writes and commands are always disabled in untrusted workspaces.
.env, certificates, private keys and SSH/AWS/Kubernetes credential paths follow the sensitive-file policy: blocked by default, confirmed with the target file shown when set to "Ask every time", and only read automatically when set to "Allow".- Tool approvals are answered inside the chat panel (a card above the composer with Deny / Allow once and collapsible details) instead of a modal dialog that freezes the whole VS Code window. While an approval is pending you can still drag sashes, switch conversations and edit files. If the conversation waiting for approval is in the background, the history list marks it with an amber "waiting for approval" dot; a request is voided immediately when its task is stopped or finished.
- Subprocess environments strip common token, secret, password and API-key variables.
- Remote API endpoints must use HTTPS; only
localhost,127.0.0.1and::1may use HTTP. - No telemetry. Conversations, skills and agent audit records stay on your machine and can be deleted from settings.
See SECURITY.md for the full boundary description.
Images
- Input images work through the normal attachment path: screenshots, files and selections are sent as
image_urldata URLs. Images can be dragged from a past message back into the composer. - Output needs an image model. Fill in Settings → Connection → Image model for the API profile you use (for example
gpt-image-1, or whatever name your gateway uses for an OpenAI-compatiblePOST /images/generations). Leave it empty and thegenerate_imagetool is not offered to the model at all — an unconfigured tool only produces the same error every time. - Generated images are attached to the reply that asked for them, with a caption, and can be opened, copied or dragged back into the composer.
- Images in the transcript can be copied, saved and opened: hover an image (or Tab to it) for Copy image / Save…, and click the image itself to open it in the editor. Copy takes the original resolution, not the on-screen size; Save… starts in the first workspace folder and lets you pick the destination.
- No image model no longer means a silent failure: asking for a picture shows an immediate hint pointing at Settings → Connection → Image model, and the system prompt tells the agent that image output is unavailable so it does not go install mermaid-cli / puppeteer (measured: two minutes wasted on a timeout).
- Local images mentioned in a reply are shown automatically: if the reply only contains a path (for example
`tmp/diagram.svg`) and no markdown image, the panel appends the actual image (workspace files only, at most three, never duplicated), so "it generated the picture but the chat shows nothing" cannot happen again. - They live in the conversation, not your repository: bytes go to
<conversation>/images/<sha256>.<ext>, the message keeps only{ id, label, path, bytes, mimeType }. Content-addressed, so generating the same picture twice does not duplicate it, and deleting the conversation removes the files with it. - Plain markdown images in a reply render too:
(or<path with spaces>) is resolved inside a workspace folder and shown as a figure; absolute paths outside the workspace stay text.data:imagebitmaps render inline; SVG data URLs are refused on purpose. - Remote images are fetched by the extension, never by the webview:
is downloaded through the same proxy/transport as every other request, saved into the conversation folder, and then shown from that local copy. The CSP stays strict (img-src ${webview.cspSource} data:), so the webview never talks to an external host and the remote server never learns that this conversation is being read.- The download is HTTPS-only, capped at 8 MB per image, at most four images per message, and reuses
hwchat.proxy. - While it is downloading (or if it fails: 404 / auth / blocked network) the reply shows a readable line naming the host — never a bare broken-image icon, and never the raw URL.
- The download is HTTPS-only, capped at 8 MB per image, at most four images per message, and reuses
- Image generation can live in a different API profile than chat:
generate_imageis offered as soon as any profile has an Image model filled in, and it always calls that profile's own endpoint and key. Settings → Connection → Image model has a Test image button that probes the endpoint for free (an emptyPOST /images/generations: 404 means "no image API here", 400/422 means "here, but I need the parameters").
History and cache
- Every message is stored independently with same-directory temp files, atomic replacement and recovery backups; a corrupt index is rebuilt from disk.
- Streaming replies are persisted every 1.5 seconds, so content already produced survives an abnormal exit.
- Conversations can be pinned, archived, restored, searched, deleted and exported as a stream.
- Source history referenced by a continuation is protected from automatic cleanup, and deleting a source warns about the effect on on-demand retrieval. Continuations keep the local digest created at link time.
- Deleting only moves a conversation to the recycle bin; destroying content is your call alone: deleting moves the folder to
history-v1/trash/(content, order and attachments untouched), hides it from the list, and it can be brought back at any time withHWChat: Restore deleted conversationsor Settings → Storage → "Restore from recycle bin". OnlySettings → Storage → Empty recycle bin (permanent)(commandHWChat: Empty the recycle bin) and "Delete local data" actually destroy content, and both ask for modal confirmation. Automatic cleanup does exactly two things: trim cache pertaskCacheRetentionHours, and tidy conversations with zero messages — a conversation with content is never taken away by the agent or by a cleanup task. - Archiving writes a disk marker: archiving drops a
.archivedfile inside the conversation folder and the index is reconciled against it at startup, so an archive can never silently become "cleanable" history again whenmanifest.jsonis corrupt or falls back to an older backup. Startup also compares against the previous archive list and warns immediately if an archived conversation is neither on disk nor in the recycle bin. - The chat record is an archive; the task tree is the agent's memory. Each turn sends only the recent slice of raw turns (about 24) plus the task tree and task list; older turns are represented by the task titles and one-line outcomes inside
<project_memory>instead of being replayed word by word. Besides what was done, the memory also records the constraints the user gave ("don't touch the capsule style", "keep the Esc shortcut") so a later turn cannot undo a rule that was already set. Retrieval is automatic: every turn the host scans the older record with keywords taken from your message (fuzzy — different wording still matches) and injects the hits as<auto_recall>; tool output archived underpayloads/is searched too. For clues that only appear mid-run the model can still callsearch_conversation_history(archived content included). When one term maps to several tasks, it proceeds with the closest match and states the assumption, and only asks you when the candidates are genuinely tied, and if it needs the archived tool output or attachment body of one message it callsread_message_detail. The full record stays on disk unless you clean it up yourself. - Heavy payloads of finished tasks (reasoning, token detail, tool input/output, attachment bodies) are moved to
payloads/inside the conversation folder on schedule — not deleted, and always restorable — while the final reply, total tokens, skills actually used, tool summaries, file lists and approval results stay in the message itself. - Pasted and generated images are written to
<conversation>/images/<sha256>.<ext>and only the path is kept in the message: a message with two screenshots drops from 2.7 MB to tens of KB. - Inside a single run only the six most recent tool outputs stay verbatim and older ones collapse into a one-line summary: measured on a real conversation, tool results were re-sent every step and single turns reached 1.37M–20.28M prompt tokens.
- Both the UI and the model context have count and byte limits; attachments additionally have per-file, count and total-size limits.
- When the disk budget is exceeded, ordinary conversations are evicted least-recently-used first; pinned, archived and running conversations are never deleted.
Install
Requires VS Code 1.106.0 or newer.
bash scripts/install-local.sh
scripts/install-local.sh picks the newest VSIX in the project root, locates the VS Code code CLI on its own, and passes --force so re-installing the same version works. When no code is found it does not just fail: it prints the two alternatives (Shell Command: Install 'code' command in PATH, or the Extensions view ⋯ → Install from VSIX…). --check reports which package would be installed and what is installed now without installing; --list only lists installed versions; for a VS Code that lives elsewhere (Insiders, say) pass HWCHAT_CODE_CLI=/path/to/code bash scripts/install-local.sh.
The equivalent one-liner, without the script:
code --install-extension "$(ls -t hwchat-*.vsix | head -n 1)" --force
It always installs the newest VSIX in the project root, so it never goes stale.
Reload the window afterwards (
Developer: Reload Window). The chat UI runs inside the installed extension host, so without a reload you are still testing the old code.
Open the command palette and run HWChat: Open chat panel. On first use, open settings, create an API profile and save its API key — the key only goes into VS Code SecretStorage, never into settings.json, project files or the VSIX.
Build from source
Requires Node.js 20+.
npm install
npm run check
npm test
npm run package
The build output is hwchat-<version>.vsix in the project root, where <version> comes from package.json. A version already published to the Marketplace cannot be uploaded again, so bump the version for every public build.
Nothing in this README needs editing when packaging: the Extensions view and the Marketplace read the version, repository, license and issue links from package.json, so they are never duplicated here. Version history lives in CHANGELOG.md.
The extension icon is resources/logo.png. Press F5 in VS Code to launch the extension development host.
Key settings
hwchat.language— interface language:auto(follow VS Code),zhoren.hwchat.apiProfiles/hwchat.activeApiProfileId— OpenAI-compatible profiles and the active one.hwchat.baseUrl/hwchat.model— legacy-compatible endpoint and current default model.hwchat.defaultMode/hwchat.agentMaxSteps— default mode and per-turn tool-loop budget. The budget defaults to 24 and is capped at 200;0(the old "unlimited") and invalid values fall back to the default, so an old saved conversation can never bypass the cap. When the budget runs out the agent stops calling tools, keeps every result, and tells you to reply "continue". Both only seed new conversations; once a conversation exists its own record wins and panel changes are written back to that conversation. Those messages also stay visible in the task tree: while no run is active the panel rebuilds a "resumed" tree from the persisted list (so it survives a window reload), and each restored node is marked Resumed with an accent bar and a tooltip explaining why it is there. Restored nodes can be edited or deleted straight from the tree without waiting for a run. - Messages you send while the agent is busy are never dropped. Each queued message is stamped with its arrival order, and a later message that would normally merge into the running branch is held behind any earlier message that is still waiting its turn - so the order you sent them in is the order they run, and an earlier message can no longer be starved out by a branch that hits the step budget or is stopped. The step budget is per branch (a queued message gets its own), and the agent loop extends the budget while the queue still holds something instead of ending the turn. On any finish - completed, stopped, or failed - the remaining messages stay listed as "not run" (user bubbles keep the not-run-yet badge instead of being marked skipped, and placeholders say the next turn will continue), and the ids are persisted per conversation. The next turn (including the Continue button) reads that list and re-queues the messages in their original order; deleting a message removes it from the list so it is never executed.Six task types get their preferred tools from the host (not suggested by the prompt):
web-preview,image-generation,git-write,test-run(the command is detected: pnpm/yarn/npm, go, cargo, pytest, make, composer, rspec),release(asks for the version first, never letsnpm versionrewrite manifests on its own) andsensitive-config(reads.env.exampletemplates instead of the real.env). Three gates apply together: the offered tool list is narrowed, a wrong tool is denied at execution time with the right one named, and the prompt directive is only the third line of defence. A write intent always disables narrowing, so "run the tests and fix what fails" can still edit files. When a path is rejected the reply now contains a runnable replacement (/tmp→ atmp/inside the workspace).Showing the user a local page / starting a server:
run_commandacceptsbackground: true(starts the process, returns immediately with a background id, and is cleaned up when the session ends or you press Stop), thenopen_web_previewopenshttp://127.0.0.1:<port>/. Do not use the bridged VS Code terminal tool (run_in_terminal) — it requires a chat-request invocation context, which an independent panel can never provide, so it is no longer offered at all. Server-class commands (python3 -m http.server,pnpm dev,vite,uvicorn,php -Sand friends) are moved to the background by the host even when the model forgets the flag, because the foreground path kills the whole process group when its timeout expires — a start command that "runs" and then leaves an empty port is exactly the "preview will not open" report. Before opening a local preview URL the panel makes one TCP probe: nothing listening means the preview is not opened at all, and the reply names the port plus the exactbackground: truecall to retry, instead of silently showing an error page.Streaming tool updates are patched in place instead of rebuilding the message. A tool-status push used to replace the whole message node, which restarted the pending badge's pulse animation, dropped text selection inside the command, re-created the copy button under the cursor and reset
prescroll — all of which reads as flicker on an expanded command step. The panel now matches each step bycallIdand updates its status, summary, meta and body in place (skipping the badge when the status has not changed), only rebuilding a body when its content signature changed, and it handles the mixed case — text growing and a tool changing in the same frame — by patching the step first and then appending the text. Anything structurally different still falls back to a full rebuild.The plaintext-credential warning no longer fires on a reference.
password: process.env.DB_PASSWORDis not a secret, but the assignment rule only looked at "a field namedpasswordfollowed by 8+ characters" — and that expression happens to be exactly 23 characters, which is what the warning reported. Values that clearly point elsewhere (process.env.X,os.environ[…],${X},$X,%X%, an ALL_CAPS variable name, a dotted property chain,undefined/null) are now skipped on the assignment path only; fixed-format keys (AKIA…,sk-…,ghp_…) are still matched, and a literal secret is still reported. The same pass closed a real gap:DB_PASSWORD=<literal>in a pasted.envwas not detected at all before.Answering a plan question leaves a message bubble — with its attachments. Both ways of answering used to leave a trace only inside the tool result (typing your own approach went into the
ask_user_choicereturn value; clicking an option left nothing at all), so the conversation showed "asked → carried on" with your answer missing, and the attachments were cleared outright. Each answer is now stored as a real user message (done): typed answers keep their text, attachments are first turned into real paths (pasted images go intoattachment-cache, picked files keep their original path, selected text is inlined) and listed in the answer so the model can open them, and clicking an option records "Chose option: …" together with anything attached at that moment. Attachment-only answers count as answers too.Clicking a line in the task tree jumps to that task's output cursor. Task nodes now carry the reply message id (they only had the user message before, so a jump landed on your own sentence), the whole row is clickable (Enter/Space too, and the inline delete/edit buttons do not trigger it), the scroll anchor is the streaming
.stream-cursorrather than the top of the bubble, and the virtualised window is moved first when the target is off-screen. Auto-follow is switched off after the jump so the next delta cannot drag you back to the bottom, and the landing spot flashes for two seconds. This is what makes merged execution readable: when a later message finishes first and the middle one runs afterwards, the cursor sits mid-list and one click gets you there.Web search actually returns results again. Its only backend (Bing's
format=rss) now answers HTTP 200 with an empty channel, so every query came back as "no results".search_webnow queries three sources in parallel and merges them: Bing RSS, Stack Overflow and Hacker News (the last two need no key). Hits are labelled with their source, every source is retried with a relaxed query because all of them AND their terms, and when everything is empty the reply lists what each source said instead of a bare "nothing found".search_github_reposlikewise auto-relaxes a zero-hit query (six words AND-ed together is almost never a real repo) and says which shorter query worked.A redundant
cdinto the directory you are already in is dropped before running (and the result says so).run_command's cwd is the conversation's project root, socd "Personal Workstation OS" && …looked for a same-named subdirectory and always failed with/bin/sh: cd: … No such file or directory. It is stripped only when all three hold: the command starts with a single-argumentcd, that target does not exist under the cwd, and its last segment equals the cwd's basename.Expanding a command step no longer flickers while the agent is streaming. Two causes were fixed: the lazily-built body used to appear one frame after the
<details>was restored to its open state (thetoggleevent that triggers the build is dispatched asynchronously), so a node was briefly inserted open-but-empty; and thepreblocks holding the command and its output are their own scroll containers, so replacing the whole message reset them to the top mid-read. And the real culprit: tool updates no longer rebuild the message. Matching each step bycallIdand updating it in place keeps the animation, the text selection inside the command, the hovered copy button and theprescroll position alive; a body is only re-created when its content changed, and the mixed case (text growing plus a tool changing in one frame) patches the step first, then appends the text. The body is now built synchronously when the open state is restored, and everypreinside the message has itsscrollTop/scrollLeftcarried over to the replacement. - A leadingcdnow decides how later../paths resolve:cd …/src-tauri && mkdir -p ../tmp/xwas rejected as out-of-workspace because only the tool'scwdargument was used. Each&&/;/newline segment now resolves against the directory in effect at that point (only a plaincd <one path>moves it;cd "$(…)"does not). - Bridged VS Code tools also answer to their natural names: callingopen_browser_pageinstead ofhwchat_vscode_open_browser_page_<hash>used to come back as “tool not allowed”; the bridge now resolves the bare name first (hwchat_*stays reserved).A failed edit explains itself instead of just saying "oldText does not exist". If the
newTextis already in the file the call reports success with the line number and leaveschangedFilesempty, so re-running the same edit no longer looks like a failure (a repeated edit used to send the model off trying other spellings). When the text really differs, the reply carries the file's real content at that position — either "the content is there from line N, only the whitespace differs" or "the first line matches at line N, everything after it changed" — bounded to 14 lines, so the model pastes the truth instead of guessing again. - A command timeout is no longer silent about the cap.run_commandkeepshwchat.maxCommandSecondsas a hard ceiling, but it now reports both numbers —timed out (120s) (asked 900s, capped at 120s)— and the result carries three ways forward: raise the setting (max 900), run it in the background with output redirected to a log inside the workspace and polltail -n 60, or stop wrapping long builds in| tail -40(that buffers everything, which is why the timeout arrives with no output at all). A timed-out command is always reported as an error now, even if its exit code happened to be 0. Heredoc bodies (python3 - <<'PY' … PY) are no longer scanned as command-line paths either: a CSS comment starting with/*used to be rejected as an out-of-workspace path, and only quoted absolute paths inside the body are still checked (soopen('/etc/passwd')stays blocked).hwchat.searchExclude— extra directory names excluded from HWChat's workspace search (editable in Settings → Agent → Search exclusions; commas, ideographic commas and newlines all work), on top of the built-in list (.git,node_modules,dist,build,out,coverage,.next,.turbo,.venv,venv,__pycache__,DerivedData,.cache). Searches also run one at a time, identical concurrent searches are merged, and results are cached for ~1.5 s with invalidation on every write/save/delete. Commands get their own limit of two and drop to one at a time for 5 s after anEAGAIN-class resource error. The skill list is no longer rescanned on every state push (30 s freshness window plus request coalescing, with watcher-driven forced refreshes), command output is accumulated within a byte budget instead of re-encoding the whole buffer per chunk, and history is read once instead of twice at startup.HWChat: Show resource statsprints live search/command counters for troubleshooting.hwchat.reasoningEffort— five levels (default, none, low, high, max). The picker follows what the model itself declares (DeepSeek's/modelslistslow/high/maxundereffort.supported_levels;noneis not in that list because it means "thinking off", so it is always offered for any reasoning-capable model). Choosing "none" really turns thinking off (thinking: {type:'disabled'}+reasoning_effort: 'none'). Endpoints without support get an automatic retry. Also only a default for new conversations.hwchat.permissionPreset,hwchat.agentMaxSteps,hwchat.reasoningEffort— deprecated, no effect. Every new conversation starts at “Ask every time” / 24 steps / “Default (model)”; adjust the three under the composer for the current conversation (24 / 68 / 120 / unlimited; Default / none / the depths the model declares; four presets) and the choice is stored with that conversation. The keys stay registered only so oldsettings.jsonfiles do not report unknown settings.hwchat.fileReadPolicy/hwchat.fileWritePolicy/hwchat.commandPolicy/hwchat.dangerousCommandPolicy/hwchat.sensitiveFilePolicy— fully derived from the preset; display-only, marked deprecated in the VS Code settings UI.Permission settings are
resource-scoped and may be set in a folder's.vscode/settings.json. Precedence is most-specific-first (workspace folder →.code-workspace→ user), and when folders disagree the strictest value wins (Ask every time>Ask on risky actions>Autopilot>Full access).hwchat.allowSensitiveFiles/hwchat.allowDangerousCommands— deprecated booleans, used only as a migration fallback when the newer settings are absent.Every resident cache now has a byte budget, not just an entry count: message page cache 24 MB (it used to be "at most 8 pages" — 48 MB when full; 5 conversations measured 17.7 MB on this machine), search-result cache 8 MB, search scheduler cache capped at 48 entries with expired pruning on every write (it previously had only a 1.5s TTL, so keys that were never queried again stayed forever), attachment body index 16M chars. Over budget evicts the oldest; a single item over budget is not cached at all.
HWChat: Show resource statsprints fourmemory · …lines with each cache's current usage and limit plus heap/rss.History lists no longer carry task-archive blobs: 96% of that payload used to be
todoArchives(measured: 5 conversations 174.9 KB → 7.1 KB; extrapolated to 100 conversations 3.42 MB → 142 KB) even though the sidebar never reads it — the archive capsules read the top-level field. Lists now send a trimmed summary.Attachments in history never silently fail: image bodies live in one evictable in-memory index (16M chars), but each attachment also has an eviction-proof pointer. On a miss HWChat re-reads the message from storage (0.6 ms measured) and puts it back in the index — both "add to composer" and "copy image" go through that recovery path.
The message list only renders the screen you are looking at. Copilot's chat list is VS Code's
WorkbenchObjectTree— a virtualized list where off-screen rows have no DOM at all — while HWChat used to render every message it knew about. Measured: 600 messages with six tool steps each came to 38,400 nodes and +231.6 MB of renderer memory, at a flat ~0.39 MB per message from 50 to 600 messages. Now only the viewport (plus eight messages of overscan on each side) is in the DOM, with two spacer blocks holding the height of the rest: +23.4 MB / 706 nodes, and a 200-message conversation drops from +83.1 MB to +16.3 MB. Three promises hold this together: a window swap re-anchors on the message at the top of the viewport and its exact on-screen offset (so scrollbar drags, PageUp and loading older messages never jump), the bottom is pixel-exact because the last window has no trailing spacer, and details you expanded are remembered indetailOverrideStoreso they are still expanded when you scroll back. Conversations under 60 messages still render in full — at that size it is a few MB and not worth the complexity. The trade-off: a selection can only span messages currently in the DOM, and "scroll to latest" jumps instead of animating (a smooth animation re-measures the scroll height every frame, so its target goes stale immediately).State pushes only carry what changed: when the message list is unchanged (pinning, archiving, settings), HWChat no longer re-sends the first page of message bodies — on a real 1513-message conversation the first 80 messages alone are 5.39 MB and one push costs ~27ms of main-thread work, while
sendState()has 22 call sites. The signature covers id / status /updatedAt/ content and reasoning length / tool count with last-step status and output length / attachment count, so a real content change always differs; a rebuilt webview bumps the generation to force a full push. The attachment cache is pruned on the cleanup heartbeat (30 days / 200 MB, never touching files written in the last hour).Automatic cache cleanup never blocks the UI: it is queued one conversation per task instead of one 154-line task holding the write queue (measured during cleanup: sends wait 41ms median / 169ms worst, while the whole round is 366–761ms), the first scan is delayed to 20s after activation to avoid VS Code's own startup I/O, and automatic heartbeats stand aside while a conversation is running (the manual "Clean cache now" still runs). A full round over a real 63.4MB archive takes 761ms on an idle machine — a multi-second entry in the log means the disk was busy with something else, not that the algorithm is slow.
hwchat.proxy— HTTP proxy for API requests (e.g.http://127.0.0.1:8080); empty means direct. Editable in Settings → Connection → API proxy; saving validates it (asocks://URL is rejected with a hint to use the HTTP port, malformed URLs are refused). It has to be set by hand, for two measured reasons: Node'sfetch(undici) ignoresHTTPS_PROXY(pointing the proxy at a dead port still connects directly), and VS Code'shttp.proxydoes not cover extensions ("Extensions don't benefit yet from the same proxy support that VS Code supports"). When set, requests go through a realCONNECTtunnel (proxy auth supported;socks://is not — use the proxy's HTTP port). Nothing is auto-detected on purpose: a leftover env var pointing at a closed port would break the direct route that works.Connection failures no longer surface as a bare
fetch failed: the message carries the real cause and a fix (DNS failure / connection refused / timeout / certificate replaced by a proxy), and HWChat retries only when no response headers were received (2 retries, 400ms then 1200ms) — never after a response, so nothing gets billed twice. Every network event is logged to the[net]lines of the HWChat output panel, andHWChat: Test endpoint connectivityreports DNS → TCP → TLS (protocol + certificate expiry) → HTTP with timings, plus a proxy-tunnel check when a proxy is configured.The timeout measures silence, not total duration:
hwchat.requestTimeoutSeconds(120 by default) used to cap the whole stream — one timer armed at request start, aborting at the deadline. A long answer or a turn with several tool calls therefore failed at second 120 even while every token was arriving, leaving only "Request timed out (120s)." Every chunk now resets the clock, so a request only times out after N seconds with no bytes at all, and the message says exactly that.Server overload is retried:
503 Service is too busy/429/500/502/504mean the request was not processed, so HWChat retries with 400ms → 1200ms → 3600ms backoff (4 attempts max; aRetry-Afterheader wins, capped at 10s).401/400are never retried — retrying them would only cost money. When retries run out, the message says the overload is temporary and that sending again usually works.hwchat.taskCacheRetentionHours/hwchat.cacheBudgetMB— task cache trimming and a disk-usage warning. HWChat never makes a conversation disappear on its own: automatic cleanup only strips regenerable payload (pertaskCacheRetentionHours) and tidies conversations with zero messages.historyRetentionDaysandcacheBudgetMBno longer trigger deletions — the budget only shows a hint with an "Open settings" button. Deleting a conversation moves it tohistory-v1/trash/(restorable viaHWChat: Restore deleted conversationsor the Settings button); only you can destroy content, through Settings → Storage → "Empty recycle bin (permanent)" or "Delete local data". There is no time- or size-based auto-purge of the recycle bin.
Conversation data lives in the VS Code global storage directory and is never written into your project. Archiving writes a .archived marker inside the conversation folder, so a corrupt or stale manifest.json (including the manifest.json.bak fallback, which holds the previous write) can never turn an archived conversation back into deletable history.
Repository layout
| Path | Contents |
|---|---|
src/core/ |
settings and validation, permissions (four presets, command tiers, path rules), conversation storage and cleanup, recycle bin, approval-plan bridge to VS Code, task lists (todos.ts, todoArchives.ts), decision gate, model capabilities, i18n (i18n.ts), ids and atomic JSON helpers, and the memory layer added in 0.4.3: contextWindow.ts (what still goes to the model + the work digest), taskMemory.ts (task tree as memory: constraints, outcomes, per-task checklist attribution), searchText.ts (normalisation, tokenising, fuzzy matching, ambiguous-term resolution) |
src/agent/ |
agent loop and stop conditions (agentRunner.ts, agentLimits.ts), tool executor and every guard (path isolation incl. per-segment cd resolution and heredoc bodies, sensitive files, git gate, version-bump gate, command risk, commandTimeout, serverCommands), skills, task queue / router / review (taskQueue.ts keeps arrival order, retains unexecuted messages and re-seeds them), search scheduler, workspace search, file-reference resolution, web research and extraction, recovery hints (pathHints, replaceDiagnostics, commandHints, previewProbe), the prompt fragments (todoPrompt, replyShapePrompt, followUpPrompt, noticePrompt, commandPrompt), audit log, network retry helpers |
src/views/ |
chat panel (webview host + message protocol), settings panel, webview shell, render signature |
src/providers/ |
OpenAI-compatible streaming client, network diagnostics and classified retries (netDiagnostics.ts), staged connectivity probe (netProbe.ts), real CONNECT proxy tunnel (proxyFetch.ts), image generation/download/probe, text-only-model fallback (visionFallback.ts) |
media/ |
webview assets. chat.js renders the panel; the pure, unit-tested helpers are code-block-meta (fence location/tool), follow-up-format (checkbox stripping), secret-scan (credential warning), todo-panel-state, callout-meta (notice severity), file-reference, toast-timing, inline-append (when a delta can be appended as plain text), stream-repair (unterminated tail markdown), ui-icons (every icon shape, inline SVG with currentColor) |
docs/screenshots/ |
screenshot build script, the generated English page and the README image |
docs/ARCHITECTURE-REVIEW.md |
architecture and feature inventory written for external review: layering, data layout, agent loop limits, tool system, permission model, memory, network layer — plus 12 specific review targets with code coordinates (SSRF redirect handling, prompt injection, command-tier bypass, approval scope, path isolation, sensitive-file matching, cross-window storage concurrency, embedding egress, panel state machine, abort classification, audit redaction, webview trust boundary) and a "deliberate trade-offs" list so those are not reported as bugs |
test/ |
preview-*.html fixtures plus 67 standalone checks run with plain node. Only a representative subset is listed here — run ls test/check-*.mjs for the full set. Coverage areas: DOM / geometry (check-panel-exclusivity, check-capsule-geometry, check-capsule-drag, check-icons-dom, check-icon-geometry, check-file-reference-dom, check-stream-patch, check-tool-detail-lazy, check-list-virtualization, check-command-location), behaviour wiring (check-todo-actions, check-todo-capsule, check-todo-scope, check-resume-scope, check-runtime-controls, check-skill-toggle, check-skill-routing, check-command-notify, check-title-editing, check-draft-isolation, check-send-latency, check-stream-scroll, check-state-payload), safety and policy (check-storage-trash, check-git-access, check-git-push-tier, check-secret-warning, check-memory-budget, check-request-timeout, check-network-diagnostics, check-webview-scripts, check-settings-coverage, check-screenshot-dict), the recovery paths added in 0.4.1 (check-no-skip, check-path-hints, check-replace-diagnostics, check-preview-guard, check-command-timeout, check-tool-block-flicker, check-vision-fallback, check-bridged-tools, check-tool-playbooks), 0.4.2's check-task-jump, check-decision-attachments, check-search-and-env, 0.4.3's check-context-memory (37 behavioural assertions on the memory model, including a replay of the real 2747 KB message that used to wipe the request), and 0.4.4's check-image-attachment (broken-image recovery, driven through the real media/chat.js in headless Chromium). Several of these drive the real media/chat.js in headless Chromium, so "does the UI actually do it" is asserted, not assumed. |
The screenshot is generated with node docs/screenshots/build.mjs. It reuses the real webview CSS and the real English dictionary, so the image matches the shipped UI, and it renders an empty new conversation: no conversations, messages, task list, attachments or typed input are included.
