@loonglab/loongcode-cli 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,33 @@ All notable changes to LoongCode will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.3] - 2026-10-13
8
+
9
+ A model-configuration and context-management release. The setup flow sets a
10
+ model's context window and output ceiling again; `/model` edits and removes
11
+ models — seeded from what is saved, never displaying a stored key, and always
12
+ tested before anything is written; and a run whose context overflows no longer
13
+ ends when compaction cannot help: the request is reduced instead, and every
14
+ compaction that cannot progress is reported rather than discarded. It also
15
+ records the rename and the command consolidation the code has carried since
16
+ 0.1.2, which are listed below.
17
+
7
18
  ### Added
8
19
 
20
+ - Model configuration is complete again in the product. The setup flow's
21
+ unnumbered `Configure limits…` sub-step sets a new model's `contextWindow` and
22
+ `maxOutputTokens` (defaulting to 128000 and 8192, validated as positive
23
+ integers with the output ceiling no larger than the window); the values are
24
+ shown on the screen that confirms the connection test, and the probe tests
25
+ exactly the configuration that will be saved. `/model` offers `Edit model…`,
26
+ which runs the same sequence seeded from what is saved — the id and its
27
+ derived name stay put, the stored API key is never displayed and is either
28
+ kept or replaced through the masked prompt, and nothing is written until a
29
+ connection test succeeds — and `Remove model…`, which confirms by name.
30
+ Removing the active model reopens setup immediately instead of waiting for the
31
+ next task; removing any other model leaves the active one alone. All three
32
+ actions are refused while a task or a compaction is running, so a model change
33
+ can never take the workspace view out from under a run.
9
34
  - An empty transcript now opens with a large `LOONGCODE` block wordmark and the
10
35
  descriptor "an opinionated coding agent", followed by the existing keyboard
11
36
  hints. The hero is a true empty state: it is centered as a group in the
@@ -58,6 +83,11 @@ All notable changes to LoongCode will be documented in this file.
58
83
 
59
84
  ### Removed
60
85
 
86
+ - The `settings.json` key `model`. It documented a "default active model id"
87
+ that nothing ever read, and its validation could fail a settings load — and
88
+ through it a run — over a value with no effect. The active model has always
89
+ been owned by `models.json`; a settings file that still carries the key keeps
90
+ loading, because unknown keys are ignored.
61
91
  - Slash command `/reload`. Prompt templates are discovered live, `AGENTS.md` /
62
92
  `CLAUDE.md` and agent-facing resources load on every run, so there is nothing
63
93
  left to refresh manually.
@@ -77,6 +107,115 @@ All notable changes to LoongCode will be documented in this file.
77
107
  capabilities now live inside the `/session` manager; they are not retained
78
108
  as aliases.
79
109
 
110
+ ### Fixed
111
+
112
+ - A run no longer ends when its context overflows and compaction cannot help. In
113
+ a single-task run the compactable region is the task itself — everything the
114
+ run produced sits after the last user message — so compaction reported
115
+ `no-progress / empty-tail` and the run stopped with `context overflow detected
116
+ but compaction made no progress: empty-tail`. The request projection is now
117
+ reduced instead: tool output the model can get back is withheld from the
118
+ request — output a cap spilled to a captured artifact (`spillPath`), or a
119
+ `read` that names the file it read (`sourcePath`, plus `resumeOffset` when the
120
+ read was capped) — while the two most recent recoverable results, failed
121
+ executions, and observed-failure evidence are kept, and each withheld result
122
+ states what it held and how to get back to it. The two kinds of route do not
123
+ promise the same thing: a spill artifact holds the output as it was, while a
124
+ path re-reads the file's current contents — so a read whose file a later write
125
+ or edit in the same history names is kept, rather than offered a route that
126
+ would return something the model never read. Only the request is reduced:
127
+ durable history is untouched, and a reference that no longer resolves fails as
128
+ a normal read error rather than returning invented content. Recovery is
129
+ bounded like compaction retries (five per run), never sends a reduced request
130
+ identical to one a provider has already rejected, and ends the run naming the
131
+ failed stage and carrying the provider's own diagnostic when nothing
132
+ recoverable remains.
133
+ - Compaction that cannot progress is no longer silent. The proactive check used
134
+ to discard a `no-progress` outcome entirely, so the only trace of it was the
135
+ failure it eventually caused; every attempt now emits a `compaction_skipped`
136
+ event naming the reason (`empty-tail`, `no-compactable-region`,
137
+ `empty-summary`) and the trigger (`proactive`, `reactive`, `provider`), a
138
+ recovery emits `projection_reduced`, and the run record carries
139
+ `compactionSkips` and `projectionRecoveries` so a finished run still explains
140
+ itself. A proactive verdict is reported once per unchanged history: the
141
+ attempt is not repeated — with its checkpoint and its event — on every
142
+ iteration that changes nothing compaction could act on, and is retried as soon
143
+ as the history moves. `/compact` reports which reason applied instead of a
144
+ bare "nothing to compact".
145
+
146
+ ## [0.1.2] - 2026-10-12
147
+
148
+ A cross-platform compatibility release. Windows gets a real choice of shell —
149
+ Windows PowerShell by default, CMD on request — and the tool layer no longer
150
+ assumes a POSIX userland underneath: file search runs in-process instead of
151
+ shelling out to `grep`, command output is decoded by contract rather than
152
+ assumed to be UTF-8, cancelling a command always returns, and `@file`
153
+ references work with spaces and Windows paths.
154
+
155
+ Verification remains Linux: the automated suite runs there, the Windows paths
156
+ are covered by simulated tests, and native Windows and macOS runs are still
157
+ outstanding.
158
+
159
+ ### Added
160
+
161
+ - **Windows shell selection.** `settings.shell` chooses which shell commands
162
+ run in on Windows: `"powershell"` (Windows PowerShell, the default) or
163
+ `"cmd"` (CMD, taken from `%ComSpec%`). It is global with a per-project
164
+ override, and an explicit choice is never replaced by the default. It applies
165
+ to Windows only — other platforms always run commands in `/bin/sh`, with the
166
+ prompts and tool descriptions they have always had. Nothing switches shells
167
+ automatically: if the selected shell cannot start, the command fails with an
168
+ error naming it instead of running somewhere else, and PowerShell 7 (`pwsh`)
169
+ is never chosen for you. CMD and PowerShell are different languages, so the
170
+ system prompt and the tool description state which one is active.
171
+
172
+ ### Changed
173
+
174
+ - **Windows PowerShell is the default shell on Windows.** An installation that
175
+ never set `settings.shell` now runs commands in `powershell.exe` instead of
176
+ CMD; one that already chose `"cmd"` — globally or per project — keeps CMD.
177
+ The change is Windows only.
178
+ - **File search no longer needs an external `grep` binary.** The `grep` tool
179
+ searches in-process, so it works where no `grep` exists — on Windows it
180
+ previously failed with "Executable not found in $PATH", which the agent read
181
+ as "no results". The interface, the output format (matching lines with
182
+ `file:line` prefixes, the 100-match cap, `No matches found.`) and the search
183
+ scope (`.git` and `node_modules` are still searched) are unchanged. Regular
184
+ expressions are JavaScript's rather than POSIX ERE: `\d`, lookahead and
185
+ non-greedy quantifiers now work, while `[[:alpha:]]`, `\<` and `\>` are
186
+ rejected with an error naming the replacement instead of silently matching
187
+ something else. This is not full GNU grep compatibility — the dialect, the
188
+ `include` glob (now the same dialect as `find`, where `{a,b}` alternates) and
189
+ the handling of unreadable paths all differ as described here.
190
+ - **A search that cannot read part of the tree says so, and still returns what
191
+ it found.** Previously a single unreadable path failed the whole search and
192
+ discarded the matches; the result now carries them with a "(Search
193
+ incomplete: …)" note. Special files such as FIFOs and devices are skipped
194
+ rather than read, which removes a way for a search to block indefinitely.
195
+ - **Subprocess output is decoded as UTF-8 unless the whole stream proves
196
+ otherwise.** On Windows, output that is not valid UTF-8 — `cmd.exe`
197
+ built-ins and many native tools write the console code page — is decoded
198
+ with the console code page and the result says which one was used, instead
199
+ of arriving as mojibake. That fallback is a labelled best guess, not
200
+ detection of what a program intended: the console code page describes the
201
+ console, not the program, and a stream can be valid UTF-8 while having been
202
+ written in another encoding. When no code page can be determined, the output
203
+ says that instead of pretending. POSIX decoding is unchanged.
204
+
205
+ ### Fixed
206
+
207
+ - **Cancelling a command always returns.** Aborting a run (Esc) settles the
208
+ tool call within a bounded grace period even when the command refuses to
209
+ die; previously a Windows cancellation whose `taskkill` was missing or failed
210
+ could leave the call waiting forever, with no error and no diagnostic.
211
+ Termination is still best-effort — a process or descendant that escapes the
212
+ process tree can survive — and the result says explicitly when cleanup could
213
+ not be confirmed, rather than implying the tree is gone.
214
+ - **`@file` references now work with spaces and Windows paths.** `@"my
215
+ notes.md"` and `@C:\src\a.ts` (either slash) expand to the file's content
216
+ like any other reference; they used to be left as literal text. Unresolved
217
+ references still stay literal, so `@` in ordinary prose is never mangled.
218
+
80
219
  ## [0.1.1] - 2026-10-12
81
220
 
82
221
  Fixes Backspace in the terminal environments where the key arrives as a raw
package/README.md CHANGED
@@ -11,6 +11,10 @@ in an interactive terminal UI.
11
11
  LoongCode is a single platform-independent package: the same install works on
12
12
  Windows, macOS, and Linux, on both x64 and arm64.
13
13
 
14
+ Cross-platform compatibility improvements are implemented and automated
15
+ verification has been performed on Linux; native Windows and macOS verification
16
+ remains pending.
17
+
14
18
  ```sh
15
19
  npm install -g @loonglab/loongcode-cli
16
20
  cd my-project
@@ -21,9 +25,16 @@ On first launch no model is active, and LoongCode says so: it opens the setup
21
25
  flow (protocol `openai` or `anthropic`, endpoint, model name, API key) before
22
26
  the workspace appears, and the normal interface is not reachable until a model
23
27
  is active. `/model` is that same flow — it lists the models you have configured
24
- and offers `Add model…` for a new one. Context and output limits are defaulted,
25
- and only exposed under an optional *Configure limits…* step. Cancelling setup
26
- exits; a task you had already typed is not run and is not saved.
28
+ and offers `Add model…`, `Edit model…` and `Remove model…`. Context and output
29
+ limits are defaulted to 128000 and 8192, and changeable in the flow's optional
30
+ *Configure limits…* step. Cancelling setup exits; a task you had already typed
31
+ is not run and is not saved.
32
+
33
+ Editing a model reuses the flow, seeded from what is saved: the stored API key
34
+ is never displayed — you choose to keep it or enter a replacement — and the
35
+ change is saved only after a connection test succeeds. Model changes are refused
36
+ while a task or a compaction is running, and removing the active model reopens
37
+ setup.
27
38
 
28
39
  ## Scripting
29
40
 
@@ -44,4 +55,30 @@ Configuration and sessions live under your user config directory
44
55
  (`~/.loongcode/`) — never inside
45
56
  this package.
46
57
 
58
+ ## Windows shell
59
+
60
+ On Windows, commands run in Windows PowerShell (`powershell.exe`) by default.
61
+ To run them in CMD instead, add `shell` to `settings.json`:
62
+
63
+ ```json
64
+ {
65
+ "shell": "cmd"
66
+ }
67
+ ```
68
+
69
+ - `"powershell"` (default) — `powershell.exe`, started with `-NoLogo
70
+ -NoProfile -NonInteractive`; `"cmd"` — `cmd.exe`, taken from `%ComSpec%`.
71
+ - Global (`~/.loongcode/settings.json`) with a per-project override
72
+ (`.loongcode/settings.json`); the project value applies, so an explicit
73
+ choice is never replaced by the default.
74
+ - Windows only: other platforms always run commands in `/bin/sh`.
75
+ - CMD and PowerShell are different languages — their syntax, built-ins and
76
+ scripts are not interchangeable, and neither has POSIX commands (`ls`, `cat`,
77
+ `grep`, …).
78
+ - Nothing switches shells automatically: if the selected shell is unavailable
79
+ the command fails with an error naming it, including when PowerShell is the
80
+ default. `pwsh` (PowerShell 7) is not selected for you.
81
+ - Choose `cmd` for CMD syntax, batch built-ins, or tooling that expects
82
+ `%ComSpec%`.
83
+
47
84
  See the repository README for the full product documentation.