@gencode/web 0.2.2 → 0.3.0

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @gencode/web
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c0def9b: `runAgent` now accepts an optional `env` field on `AgentRunParams` for passing session-scoped environment variables that are isolated to the current run. When supplied, the map is merged into the environment of every child process spawned by the built-in `exec` and `process` tools, and is also exposed to plugin scripts through the read-only `api.runtime.session.env` accessor (carried in the plugin runtime context under `env`). When a single `exec` call also passes its own `env`, the merge order is `process.env` < run-level `env` < per-call `env`, so per-call values override the run-level ones. The map is held in memory only for the duration of the run; it is never written to disk and never crosses a session boundary. The `subagent_spawn` and `batch_subagent_spawn` tools now also forward `env` to child runs through the standard `InheritedRunParams` plumbing, so subagent sessions inherit the same session-scoped env without any extra configuration. Downstream entry points that pass `AgentRunParams` through to the runner (`@gencode/cli`, `@gencode/plugin-sdk`, `@gencode/console`, `@gencode/web`) need to be re-released to expose the new field; no other call-site changes are required.
8
+
9
+ The `aimax run` command now accepts a new `--env <kvlist>` flag for setting session-scoped env vars from the command line. The value is a comma-separated list of `KEY=VALUE` pairs (e.g. `--env TENANT=acme,TOKEN=secret`); backslash-escape `,` and `=` inside values if you need literal ones, and use `KEY=` to pass an empty string. The parsed map is forwarded as `AgentRunParams.env`, so the merge order, plugin visibility, and subagent inheritance described above all apply to CLI runs as well. The start banner shows only the number of keys injected — values are never printed.
10
+
11
+ ### Patch Changes
12
+
13
+ - 364c7d9: Improves long-session context compaction stability. Session memory, automatic compaction, manual `/compact`, and context-limit recovery now build summarisation requests from bounded context views, so large historical turns are truncated or omitted before the summariser call instead of being sent as an oversized request. Default CLI behavior is unchanged; the fix applies automatically when continuing long sessions with the configured `--context-window` or `AIMAX_CONTEXT_WINDOW`.
14
+ - 03c58de: Agent runs are now resilient to progress delivery failures that happen immediately after an `exec` tool finishes. If stdout rendering, callback delivery, or websocket progress handling fails while reporting a tool result, `aimax run` logs the progress failure and continues the agent run instead of treating the reporting failure as a fatal task error. Tool result progress output is also normalized to text before rendering, so unusual or empty tool result payloads no longer crash the CLI output path.
15
+ - bcbb53f: Smart topic segmentation can now load its local embedding model from the installed CLI package. Set `AIMAX_EMBEDDING_MODEL_URL` during `@gencode/cli` installation to have the CLI `postinstall` download the model archive into `models/Xenova/bge-small-zh-v1.5/`; leave it unset to skip the download with no network access or install failure. Deployments may also set `AIMAX_EMBEDDING_MODEL_SHA256` to verify the archive. At runtime, `aimax run` and `aimax resume` automatically pass the installed `models/` directory to agents, while missing models continue to degrade without remote model downloads.
16
+ - 379f84e: `AgentRunParams.projectDir` is now honored as the effective session workspace directory. When `aimax run` or `aimax resume` is started with `--project-dir <path>` (or the equivalent `projectDir` field passed through the plugin SDK, console, or web entry point), the agent operates directly on that directory instead of the default `<dataDir>/workspace` mount. When `projectDir` is empty or omitted, the previous `<dataDir>/workspace` layout is preserved unchanged. The `subagent_spawn` and `subagents` tools now also forward `projectDir` to child runs, so subagents started inside a `--project-dir` session share the same project workspace without any extra configuration. The new `resolveWorkspaceDir` helper in `@gencode/agents` is the single source of truth for this rule, used by the runner, the session lifecycle, and the tool factory.
17
+ - d0edcb7: LLM provider errors returned inside an HTTP 200 stream now surface the provider's readable message directly, without the internal `LLM upstream returned an error payload in a 200 stream` prefix. Transient failures that only expose the generic `LLMRequestError` marker are also retried by the existing turn retry policy, while structured provider status codes such as `502`, `500`, and `429` keep the same retry behavior and non-retryable errors such as `404` still fail immediately.
18
+ - Updated dependencies [364c7d9]
19
+ - Updated dependencies [03c58de]
20
+ - Updated dependencies [bcbb53f]
21
+ - Updated dependencies [379f84e]
22
+ - Updated dependencies [c0def9b]
23
+ - Updated dependencies [d0edcb7]
24
+ - @gencode/console@0.3.0
25
+
26
+ ## 0.2.3
27
+
28
+ ### Patch Changes
29
+
30
+ - 4a2a4f7: 修复使用 `apiFormat: "anthropic-messages"` 连接 Anthropic Messages API 或兼容网关时,部分网关只在完整 assistant 消息中返回最终文本、或返回格式正常但没有文本和工具调用的空响应,导致 agent 可能丢失最终回复或静默结束的问题。修复后系统会从完整 assistant 消息中补齐最终文本,并将真正的空响应识别为可重试错误交给既有重试逻辑处理,无需调整 API 配置。
31
+ - 833f2dc: 为 agent 运行的收尾阶段增加超时保护与降级策略,避免因单个步骤阻塞导致整个流程挂起:
32
+
33
+ - **Session 标题生成**:增加 5 秒超时上限,超时或生成失败时自动降级为基于首条消息的本地标题,不再阻塞 session 结算流程。
34
+ - **Agent 运行超时**:启用 agent run 的 10 分钟默认超时(可通过 `timeoutMs` 参数配置),超时后优雅中止并记录诊断日志,而非无限挂起。
35
+ - **HTTP Callback 回调**:为 callback 事件投递增加 5 秒超时,超时或网络错误时仅记录日志,不再抛出异常导致进程崩溃。
36
+ - **WebSocket 连接与关闭**:为 WebSocket 建连和关闭分别增加 5 秒超时保护,防止连接异常时事件发送流程阻塞。
37
+
38
+ - Updated dependencies [4a2a4f7]
39
+ - Updated dependencies [833f2dc]
40
+ - @gencode/console@0.2.3
41
+
3
42
  ## 0.2.2
4
43
 
5
44
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gencode/web",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -13,7 +13,7 @@
13
13
  "CHANGELOG.md"
14
14
  ],
15
15
  "dependencies": {
16
- "@gencode/console": "0.2.2",
16
+ "@gencode/console": "0.3.0",
17
17
  "@gencode/shared": "0.2.0"
18
18
  },
19
19
  "devDependencies": {},