Skip to content

Commit fc97baa

Browse files
authored
Merge pull request #283 from modelstudioai/fix/log-workspace-issue
Fix/log workspace issue
2 parents 1d99e03 + 6009ea1 commit fc97baa

65 files changed

Lines changed: 2045 additions & 339 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,42 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
66

77
[中文版](CHANGELOG.zh.md) · [README](README.md) · [Contributing](CONTRIBUTING.md)
88

9+
## [2.6.2] - 2026-10-28
10+
11+
### Changed
12+
13+
- **Default telemetry output (BREAKING)**: Business results from `bl alert`, `bl monitor`, and `bl log` now default to JSON, even when the Profile specifies text. Scripts relying on text must pass `--output text` or set `DASHSCOPE_OUTPUT=text`.
14+
15+
### Fixed
16+
17+
- **Workspace identity**: Resolve the selected workspace's Console identity automatically and share it across preflight, business requests, asynchronous polling, and follow-up requests, fixing ineffective `--workspace-id` filtering and incorrect cross-workspace results without changing saved configuration.
18+
- **Audit log parsing**: Normalize timestamps, models, request IDs, workspace IDs, and usage; fix missing fields, NaN timestamps, and malformed count displays, and reject audit results from a mismatched workspace.
19+
- **Log counts**: Use each corresponding list API's `totalCount` for `log audit count` and `log inference count`, fixing zero counts for non-empty lists without paginating or fetching full log content.
20+
- **Inference count filters and completion**: Preserve multiple-model and multiple-API-key filters by deduplicating and querying single-value combinations. Support asynchronous polling and emit totals only after every query succeeds; reject empty filters, invalid counts, and aggregate overflow.
21+
- **Dry-run previews**: Show the workspace identity resolution plan and actual count request combinations without sending business requests.
22+
23+
## [2.6.1] - 2026-10-28
24+
25+
### Added
26+
27+
- **Asynchronous Batch inference**: Add `bl batch convert/create/list/get/cancel/download` for CSV-to-JSONL conversion, Chat/Embedding task creation, progress tracking, cancellation, and result/error downloads with optional CSV export.
28+
- **Synchronous Batch Chat**: Add `bl text chat --batch` for one non-streaming request, separate from asynchronous file-based Batch tasks, with request timeouts of 60–3600 seconds.
29+
- **Model recommendation options**: Add `--top`, `--model`, `--no-agent`, `--trace`, `--think`, and `--no-thinking` to `bl advisor recommend`.
30+
31+
### Changed
32+
33+
- **Model recommendations**: Upgrade intent analysis, routing, recall, scoring, and ranking; support Agent clarification in interactive terminals and multi-step recommendations while preserving the existing recommendation JSON envelope.
34+
35+
### Removed
36+
37+
- **Advisor library interfaces (BREAKING)**: Remove legacy recommendation exports, including `getModels`, `recallCandidates`, `recallSemantic`, and `rankModels`. Library consumers must adapt to the new recommendation engine; legacy types are exported as `LegacyIntentProfile`, `LegacyModelProfile`, and `LegacyRecommendResult`.
38+
39+
### Fixed
40+
41+
- **Temporary file uploads**: Select the upload service from the active model endpoint, fixing Singapore and Prime video uploads incorrectly using Beijing. Official temporary uploads support only Beijing and Singapore; unsupported regions and Token Plan fail explicitly, while explicit custom upload proxies are no longer rejected based on key type.
42+
- **Node 26 compatibility**: Fix fetch/dispatcher incompatibility and proxy initialization across model requests, console requests, uploads, and downloads.
43+
- **API error passthrough**: Recognize nested business errors and preserve non-JSON error bodies and request IDs instead of treating error responses as successful results.
44+
945
## [2.6.0] - 2026-10-27
1046

1147
### Added

‎CHANGELOG.zh.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,42 @@
66

77
[English](CHANGELOG.md) · [README](README.zh.md) · [参与贡献](CONTRIBUTING.zh.md)
88

9+
## [2.6.2] - 2026-10-28
10+
11+
### 变更
12+
13+
- **遥测默认输出(BREAKING)**:`bl alert`、`bl monitor` 和 `bl log` 的业务结果统一默认 JSON,即使 Profile 配置为 text。依赖文本输出的脚本需显式传入 `--output text` 或设置 `DASHSCOPE_OUTPUT=text`。
14+
15+
### 修复
16+
17+
- **工作空间身份**:遥测命令根据选定空间自动解析 Console 身份,预检、业务请求、异步轮询及后续请求使用同一身份,修复 `--workspace-id` 过滤失效及跨空间结果异常;不修改已保存配置。
18+
- **审计日志解析**:规范化时间、模型、请求 ID、工作空间及用量字段,修复缺失字段、NaN 时间及异常计数展示;拒绝空间不匹配的审计结果。
19+
- **日志计数**:`log audit count` 和 `log inference count` 分别采用对应列表接口的 `totalCount`,修复列表非空而计数为 0 的问题,不遍历分页或获取完整日志内容。
20+
- **推理计数过滤与完成判定**:保留多模型、多 API Key 过滤,去重后按单值组合查询并汇总;支持异步轮询,仅全部成功后输出,空过滤、无效计数及累计溢出明确报错。
21+
- **Dry-run 预览**:展示工作空间身份解析计划和实际计数请求组合,不发送业务请求。
22+
23+
## [2.6.1] - 2026-10-28
24+
25+
### 新增
26+
27+
- **异步批量推理**:新增 `bl batch convert/create/list/get/cancel/download`,支持 CSV 转 JSONL、创建 Chat/Embedding 批量任务、跟踪进度、取消任务及下载结果和错误文件,可选导出 CSV。
28+
- **同步 Batch Chat**:`bl text chat --batch` 支持单次非流式请求,与异步文件批量任务分开使用;支持 60–3600 秒请求超时。
29+
- **模型推荐参数**:`bl advisor recommend` 新增 `--top`、`--model`、`--no-agent`、`--trace`、`--think` 和 `--no-thinking`。
30+
31+
### 变更
32+
33+
- **模型推荐**:升级意图分析、路由、候选召回、评分及排序流程;交互终端支持 Agent 澄清与多步骤推荐,推荐结果保留原有 JSON 主结构。
34+
35+
### 已移除
36+
37+
- **Advisor 库接口(BREAKING)**:移除旧推荐流程导出,包括 `getModels`、`recallCandidates`、`recallSemantic` 和 `rankModels`。库调用方需适配新的推荐引擎接口;旧类型通过 `LegacyIntentProfile`、`LegacyModelProfile` 和 `LegacyRecommendResult` 导出。
38+
39+
### 修复
40+
41+
- **临时文件上传**:根据当前模型 Endpoint 选择上传服务,修复新加坡地域及 Prime 视频上传误用北京地址的问题;官方临时上传仅支持北京和新加坡,不支持的地域及 Token Plan 明确报错,显式自定义上传代理不再因 Key 类型被提前拒绝。
42+
- **Node 26 兼容**:修复 fetch 与 dispatcher 不兼容及代理初始化问题,覆盖模型请求、控制台请求、文件上传和下载。
43+
- **API 错误透传**:正确识别嵌套业务错误,保留非 JSON 错误正文及请求 ID,避免将错误响应作为成功结果。
44+
945
## [2.6.0] - 2026-10-27
1046

1147
### 新增

‎packages/bailian-kb-dsh/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-kb-dsh",
3-
"version": "2.6.1",
3+
"version": "2.6.2",
44
"description": "Bailian knowledge-base tools for DeepSeek Harness: kb_search and kb_chat over the DashScope RAG API, plus the bl CLI management skill.",
55
"keywords": [
66
"alibaba-cloud",

‎packages/bailian-memo-dsh/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-memo-dsh",
3-
"version": "2.6.1",
3+
"version": "2.6.2",
44
"description": "Bailian personal memory for DeepSeek Harness: automatic recall, silent curation, and user-controlled remember/forget.",
55
"keywords": [
66
"alibaba-cloud",

‎packages/cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli",
3-
"version": "2.6.1",
3+
"version": "2.6.2",
44
"description": "CLI for Aliyun Model Studio (DashScope) AI Platform.",
55
"keywords": [
66
"agent",

‎packages/commands/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli-commands",
3-
"version": "2.6.1",
3+
"version": "2.6.2",
44
"description": "Command library for bailian-cli products (knowledge, memory, media, …). See https://www.npmjs.com/package/bailian-cli for usage.",
55
"homepage": "https://bailian.console.aliyun.com/cli",
66
"bugs": {

‎packages/commands/src/commands/alert/create.ts‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import {
2-
defineCommand,
3-
detectOutputFormat,
4-
effectiveConsoleGatewayConfig,
5-
unwrapResponse,
6-
} from "bailian-cli-core";
1+
import { detectOutputFormat, unwrapResponse } from "bailian-cli-core";
2+
import { defineTelemetryCommand, telemetryGatewayPreview } from "../shared/telemetry.ts";
73
import { emitResult } from "bailian-cli-runtime";
84
import {
95
ALERT_RULE_WRITE_FLAGS,
@@ -14,7 +10,7 @@ import {
1410

1511
const CREATE_RULE_API = "zeldaEasy.bailian-telemetry.alertRule.createAlertRule";
1612

17-
export default defineCommand({
13+
export default defineTelemetryCommand({
1814
description: {
1915
"en-US": "Create a model alert rule from an alert template",
2016
"zh-CN": "基于告警模板创建模型告警规则",
@@ -39,7 +35,7 @@ export default defineCommand({
3935
validate: (flags) => validateAlertRuleFlags(flags),
4036
async run(ctx) {
4137
const { settings, flags } = ctx;
42-
const format = settings.outputExplicit ? detectOutputFormat(settings.output) : "json";
38+
const format = detectOutputFormat(settings.output);
4339

4440
const reqDTO = {
4541
...(settings.workspaceId ? { workspaceId: settings.workspaceId } : {}),
@@ -51,7 +47,7 @@ export default defineCommand({
5147
{
5248
api: CREATE_RULE_API,
5349
data: { reqDTO },
54-
...effectiveConsoleGatewayConfig(settings),
50+
...telemetryGatewayPreview(settings),
5551
},
5652
format,
5753
);

‎packages/commands/src/commands/alert/delete.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { defineCommand, detectOutputFormat, effectiveConsoleGatewayConfig } from "bailian-cli-core";
1+
import { detectOutputFormat } from "bailian-cli-core";
2+
import { defineTelemetryCommand, telemetryGatewayPreview } from "../shared/telemetry.ts";
23
import { emitResult } from "bailian-cli-runtime";
34
import { parseCommaList } from "../shared/params.ts";
45
import { ensureAlertReady } from "./shared.ts";
56

67
const DELETE_RULES_API = "zeldaEasy.bailian-telemetry.alertRule.deleteAlertRules";
78

8-
export default defineCommand({
9+
export default defineTelemetryCommand({
910
description: {
1011
"en-US": "Delete model alert rules",
1112
"zh-CN": "删除模型告警规则",
@@ -39,7 +40,7 @@ export default defineCommand({
3940
],
4041
async run(ctx) {
4142
const { settings, flags } = ctx;
42-
const format = settings.outputExplicit ? detectOutputFormat(settings.output) : "json";
43+
const format = detectOutputFormat(settings.output);
4344

4445
const reqDTO = { ruleIds: parseCommaList(flags.ruleId) };
4546

@@ -48,7 +49,7 @@ export default defineCommand({
4849
{
4950
api: DELETE_RULES_API,
5051
data: { reqDTO },
51-
...effectiveConsoleGatewayConfig(settings),
52+
...telemetryGatewayPreview(settings),
5253
},
5354
format,
5455
);

‎packages/commands/src/commands/alert/disable.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { defineCommand, detectOutputFormat, effectiveConsoleGatewayConfig } from "bailian-cli-core";
1+
import { detectOutputFormat } from "bailian-cli-core";
2+
import { defineTelemetryCommand, telemetryGatewayPreview } from "../shared/telemetry.ts";
23
import { emitResult } from "bailian-cli-runtime";
34
import { ensureAlertReady } from "./shared.ts";
45

56
const DISABLE_RULE_API = "zeldaEasy.bailian-telemetry.alertRule.disableAlertRule";
67

7-
export default defineCommand({
8+
export default defineTelemetryCommand({
89
description: {
910
"en-US": "Disable a model alert rule (keeps the rule, stops notifications)",
1011
"zh-CN": "停用模型告警规则(保留规则,停止通知)",
@@ -25,7 +26,7 @@ export default defineCommand({
2526
exampleArgs: ["--rule-id 789", "--rule-id 789 --dry-run"],
2627
async run(ctx) {
2728
const { settings, flags } = ctx;
28-
const format = settings.outputExplicit ? detectOutputFormat(settings.output) : "json";
29+
const format = detectOutputFormat(settings.output);
2930

3031
const reqDTO = {
3132
workspaceId: settings.workspaceId,
@@ -38,7 +39,7 @@ export default defineCommand({
3839
{
3940
api: DISABLE_RULE_API,
4041
data: { reqDTO },
41-
...effectiveConsoleGatewayConfig(settings),
42+
...telemetryGatewayPreview(settings),
4243
},
4344
format,
4445
);

‎packages/commands/src/commands/alert/enable.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { defineCommand, detectOutputFormat, effectiveConsoleGatewayConfig } from "bailian-cli-core";
1+
import { detectOutputFormat } from "bailian-cli-core";
2+
import { defineTelemetryCommand, telemetryGatewayPreview } from "../shared/telemetry.ts";
23
import { emitResult } from "bailian-cli-runtime";
34
import { ensureAlertReady } from "./shared.ts";
45

5-
export default defineCommand({
6+
export default defineTelemetryCommand({
67
description: {
78
"en-US": "Enable a model alert rule",
89
"zh-CN": "启用模型告警规则",
@@ -23,7 +24,7 @@ export default defineCommand({
2324
exampleArgs: ["--rule-id 789", "--rule-id 789 --dry-run"],
2425
async run(ctx) {
2526
const { settings, flags } = ctx;
26-
const format = settings.outputExplicit ? detectOutputFormat(settings.output) : "json";
27+
const format = detectOutputFormat(settings.output);
2728

2829
const reqDTO = {
2930
workspaceId: settings.workspaceId,
@@ -36,7 +37,7 @@ export default defineCommand({
3637
{
3738
api: "zeldaEasy.bailian-telemetry.alertRule.enableAlertRule",
3839
data: { reqDTO },
39-
...effectiveConsoleGatewayConfig(settings),
40+
...telemetryGatewayPreview(settings),
4041
},
4142
format,
4243
);

0 commit comments

Comments
 (0)