Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ jobs:
tests/test_canonical_write_budget_postgres.py \
tests/test_framework_db_budget_postgres.py \
tests/test_history_cache_postgres.py \
tests/test_history_items_postgres.py \
tests/test_history_items_local.py \
tests/test_history_tool_refs.py \
tests/test_mainline_history_merge_postgres.py \
tests/test_pool_release_budget_postgres.py \
tests/test_resilient_unknown_commit.py \
Expand Down Expand Up @@ -144,6 +147,10 @@ jobs:
if [ "$test_code" -eq 0 ]; then test_code=$grants_code; fi
exit "$test_code"

- name: Check long-session item page latency
if: matrix.postgres == '16'
run: uv run --no-sync python -m scripts.benchmark_history_item_pages --max-p95-ms 1000

tunnel-tls:
name: Tunnel TLS on Python ${{ matrix.python }}
runs-on: ubuntu-latest
Expand All @@ -158,7 +165,7 @@ jobs:
test:
runs-on: ubuntu-latest
env:
KSADK_WEB_VERSION: "0.3.18"
KSADK_WEB_VERSION: "0.3.21"
steps:
- uses: actions/checkout@v7

Expand Down Expand Up @@ -298,7 +305,7 @@ jobs:
KSADK_TEST_EXPECTED_ADK_VERSION: ${{ matrix.google-adk }}
# Older ADK imports MCP 1.x private modules; its 2.5 metadata omits this upper bound.
MCP_REQUIREMENT: ${{ matrix.google-adk == '2.14.0' && 'mcp>=2.3.0' || 'mcp>=1.26.0,<2' }}
KSADK_WEB_VERSION: "0.3.18"
KSADK_WEB_VERSION: "0.3.21"
KSADK_TEST_POSTGRES_DSN: postgresql://ksadk_ci:ksadk_ci_password@127.0.0.1:5432/ksadk_ci
KSADK_TEST_FRAMEWORK_DSN: postgresql://ksadk_ci:ksadk_ci_password@127.0.0.1:5432/ksadk_ci
R86_TEST_CHECKPOINT_DSN: postgresql://ksadk_ci:ksadk_ci_password@127.0.0.1:5432/ksadk_ci
Expand Down Expand Up @@ -427,7 +434,7 @@ jobs:
KSADK_TEST_EXPECTED_ADK_VERSION: ${{ matrix.google-adk }}
# Older ADK imports MCP 1.x private modules; its 2.5 metadata omits this upper bound.
MCP_REQUIREMENT: ${{ matrix.google-adk == '2.14.0' && 'mcp>=2.3.0' || 'mcp>=1.26.0,<2' }}
KSADK_WEB_VERSION: "0.3.18"
KSADK_WEB_VERSION: "0.3.21"
strategy:
fail-fast: false
matrix:
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ on:
ksadk_web_version:
description: KsADK Web npm version to bundle
required: false
default: "0.3.18"
default: "0.3.21"
approved_source_commit:
description: Reviewed source commit SHA recorded in docs/maintainer-approval-record.md
description: Legacy file-based approval source (not used by PR comment sign-off policy)
required: false
publish_target:
description: Publish target
Expand All @@ -24,6 +24,8 @@ on:

permissions:
contents: read
pull-requests: read
checks: read
id-token: write

concurrency:
Expand All @@ -36,11 +38,13 @@ jobs:
environment:
name: pypi
env:
KSADK_WEB_VERSION: ${{ github.event.inputs.ksadk_web_version || '0.3.18' }}
KSADK_WEB_VERSION: ${{ github.event.inputs.ksadk_web_version || '0.3.21' }}
KSADK_APPROVED_SOURCE_COMMIT: ${{ github.event.inputs.approved_source_commit || vars.KSADK_APPROVED_SOURCE_COMMIT }}
PUBLISH_TARGET: ${{ github.event.inputs.publish_target || 'full' }}
permissions:
contents: read
pull-requests: read
checks: read
id-token: write
steps:
- uses: actions/checkout@v7
Expand All @@ -49,6 +53,11 @@ jobs:
with:
python-version: "3.12"

- name: Resolve real PR release sign-offs
env:
GITHUB_TOKEN: ${{ github.token }}
run: python scripts/resolve_release_approval.py --output-dir "$RUNNER_TEMP/ksadk-release-approval"

- uses: actions/setup-node@v7
with:
node-version: "22"
Expand Down Expand Up @@ -79,13 +88,28 @@ jobs:
if: env.PUBLISH_TARGET == 'alias-only'
run: make public-audit public-test public-build-alias-check

- name: Verify release approval gate
run: make public-publish-gate

- name: Build alias distribution
if: env.PUBLISH_TARGET == 'full'
run: make public-build-alias-check

# Re-read comments immediately before uploads, so a withdrawal during the
# build does not reuse the earlier approval snapshot.
- name: Revalidate real PR release sign-offs
env:
GITHUB_TOKEN: ${{ github.token }}
run: python scripts/resolve_release_approval.py --output-dir "$RUNNER_TEMP/ksadk-release-approval"

- name: Verify release approval gate
run: make public-publish-gate

- name: Archive verified release approval evidence
if: env.KSADK_RELEASE_APPROVAL_RECORD != ''
uses: actions/upload-artifact@v6
with:
name: release-approval-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/ksadk-release-approval/
if-no-files-found: error

- name: Publish to PyPI
if: env.PUBLISH_TARGET == 'full'
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ on:
- "scripts/audit_release_artifacts.py"
- "scripts/build_alias_distribution.py"
- "scripts/release_preflight.py"
- "scripts/resolve_release_approval.py"
- "scripts/check_approval_record.py"
- "tests/test_resolve_release_approval.py"
- "docs/maintainer-approval-record.md"
- ".github/workflows/publish-pypi.yml"
- "scripts/reviewed_web_assets.py"
- "scripts/verify_ksadk_web_static.py"
- "scripts/write_build_provenance.py"
Expand All @@ -35,6 +40,10 @@ jobs:
artifacts:
runs-on: ubuntu-latest
timeout-minutes: 25
permissions:
contents: read
pull-requests: read
checks: read
steps:
- uses: actions/checkout@v7

Expand All @@ -51,6 +60,11 @@ jobs:
with:
node-version: "22"

- name: Verify read-only GitHub release approval API access
env:
GITHUB_TOKEN: ${{ github.token }}
run: python scripts/resolve_release_approval.py --check-api-access --output-dir "$RUNNER_TEMP/ksadk-release-approval"

# pnpm 11.7.0 can hang after removing the official Codex bundle.
# Match the verified profile CLI; managed bootstrap still uses its own pin.
- name: Set up pnpm for DSH profile plugins
Expand All @@ -72,7 +86,7 @@ jobs:

- name: Build pinned frontend static assets
env:
KSADK_WEB_VERSION: "0.3.18"
KSADK_WEB_VERSION: "0.3.21"
run: make build-frontend

- name: Verify clean release source
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,36 @@
格式参考 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
版本遵循 [Semantic Versioning](https://semver.org/spec/v2.0.0.html)。

版本节记录变更范围;实际发布状态与日期以 GitHub Release 和 PyPI 记录为准,候选条目不代表制品已公开发布。


## [未发布]

## [0.8.9]

### 会话、历史与模型上下文

- 新增长会话 `items-v1` 快照分页与大内容分块读取,保留旧消息投影和原始事件读取;已有 PostgreSQL 历史按需补齐索引与分块信息,不删除历史记录。
- 修复 Responses 重连到已受理 Kernel 运行、稀疏事件回放连续性,以及 Kernel 领取命令期间的用量投影。
- 修复 LangGraph 最终答案流、压缩后模型上下文和恢复顺序;支持 DeepAgents v3 流式结果及委派工具响应,并完善 ADK/LangGraph 用量累计。
- 修复 LangGraph 直接调用工具时原生工具名未进入结果事件及会话历史的问题,保留原调用 ID、执行结果和既有历史投影。
- 修复托管 AG-UI 使用前端运行 ID 停止生成时未定位到 Kernel 运行的问题;取消只解析同租户、实例、会话的原始受理记录,旧运行引用不会停止后续任务。
- 历史中的 legacy progress 事件继续保留用于回放,仅在模型输入与摘要准备时过滤;流结束后的标题更新不再重新加载完整 transcript。

### 授权恢复

- 修复 OAuth 拒绝后重新授权时完成回执早于状态快照到达的竞态,保留较新回执等待下一次状态确认,避免丢失恢复唤醒;保持旧回执、签名、会话归属及工具副作用去重校验。

### 资源、界面与文档

- 多知识库资源绑定支持附加 dataset 与独立检索指令,保留单知识库配置摘要的稳定性。
- 内置 Web 固定为已发布的 `@kingsoftcloud/ksadk-web@0.3.21`,主包与兼容发行包共同准备为 0.8.9;候选准备不触发 npm/PyPI 发布。
- 保留公开 API 手册与 Tunnel/OAuth MCP 中英文导航;补充历史分页接口说明和新增能力回归测试。

### 依赖

- DeepAgents extra 的最低版本由 `0.6.2` 提升到 `0.6.8`。部署已有 DeepAgents Agent 前请同步项目依赖约束。

## [0.8.8]

### 新增与修复
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ PUBLIC_TEST_TARGETS += tests/test_prepare_ksadk_python_export.py
PUBLIC_TEST_TARGETS += tests/packaging/test_alias_distribution.py
# Public protocol contracts must remain in the local release gate as well as CI.
PUBLIC_TEST_TARGETS += tests/a2ui/test_official_wire.py
PUBLIC_TEST_TARGETS += tests/kernel/test_public_run_cancellation.py
PUBLIC_TEST_TARGETS += tests/agui/test_protocol_contract.py
PUBLIC_TEST_TARGETS += tests/agui/test_native_cold_resume.py
PUBLIC_TEST_TARGETS += tests/test_mcp_oauth_declarations.py
Expand All @@ -415,6 +416,7 @@ PUBLIC_TEST_TARGETS += tests/runners/test_adk_a2a_stream_review.py
PUBLIC_TEST_TARGETS += tests/events/adapters/test_adk.py
PUBLIC_TEST_TARGETS += tests/agui/test_foreground_local_interactions.py
PUBLIC_TEST_TARGETS += tests/memory/test_agent_user_scope_id.py tests/memory/test_memory_namespace_compat.py
PUBLIC_TEST_TARGETS += tests/test_check_approval_record.py tests/test_resolve_release_approval.py

public-status:
@echo "==> internal worktree"
Expand Down Expand Up @@ -620,7 +622,9 @@ public-release-approval-check:
echo " Set it to the reviewed source commit recorded in docs/maintainer-approval-record.md"; \
exit 1; \
fi
@uv run python scripts/check_approval_record.py --expected-current-commit "$$KSADK_APPROVED_SOURCE_COMMIT"
@uv run python scripts/check_approval_record.py \
--approval-record "$${KSADK_RELEASE_APPROVAL_RECORD:-docs/maintainer-approval-record.md}" \
--expected-current-commit "$$KSADK_APPROVED_SOURCE_COMMIT"

public-publish-gate: public-release-approval-check
@echo "✅ public publish gate passed"
Expand Down
6 changes: 3 additions & 3 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ Start the local debugging Web UI:
agentengine web . --no-open
```

## 0.8.8: Capabilities and Integration
## 0.8.9: Capabilities and Integration

0.8.8 requires Python 3.12+ and bundles Web companion `0.3.18`.
0.8.9 requires Python 3.12+ and bundles Web companion `0.3.21`.
This table describes this version. Before installing, check that the GitHub Release and both PyPI
distributions use the expected version.

See the [0.8.8 upgrade guide](https://kingsoftcloud.github.io/ksadk-python/en/docs/framework/guides/upgrade-0-8-8/) for Tunnel migration, Memory compatibility, dependency choices, and transport settings. Version 0.8.8 remains a candidate until its GitHub Release is published; use the reviewed wheel for evaluation.
See the [0.8.8 upgrade guide](https://kingsoftcloud.github.io/ksadk-python/en/docs/framework/guides/upgrade-0-8-8/) for Tunnel migration, Memory compatibility, dependency choices, and transport settings. Version 0.8.9 adds snapshot history paging, content chunks, model context compaction and multi-knowledge-base retrieval, and fixes an OAuth resume race. Existing chat, Tunnel, AG-UI/A2UI, A2A and API Key MCP integrations remain available. Before the release, evaluate 0.8.9 with the reviewed candidate wheel.

| Capability | Integration |
| --- | --- |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ agentengine run -i
agentengine web . --no-open
```

## 0.8.8:能力与接入
## 0.8.9:能力与接入

0.8.8 要求 Python 3.12+,内置 Web companion 为 `0.3.18`。
0.8.9 要求 Python 3.12+,内置 Web companion 为 `0.3.21`。
下表介绍本版本能力;安装前核对 GitHub Release 与两个 PyPI 发行包的版本。

[0.8.8 升级指南](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/upgrade-0-8-8/)说明 Tunnel 迁移、Memory 历史兼容、依赖选择和聊天传输配置。正式 GitHub Release 发布前,0.8.8 仍为候选,评估时使用经过审核的 wheel。
[0.8.8 升级指南](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/upgrade-0-8-8/)说明 Tunnel 迁移、Memory 历史兼容、依赖选择和聊天传输配置。0.8.9 新增长会话快照分页与内容分块、模型上下文压缩和多知识库检索,并修复 OAuth 恢复竞态;既有聊天、Tunnel、AG-UI/A2UI、A2A 和 API Key MCP 接入继续保留。正式发布前,评估 0.8.9 请使用经过审核的候选 wheel。

| 能力 | 如何接入 |
| --- | --- |
Expand Down
6 changes: 3 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ agentengine run -i
agentengine web . --no-open
```

## 0.8.8:能力与接入
## 0.8.9:能力与接入

0.8.8 要求 Python 3.12+,内置 Web companion 为 `0.3.18`。
0.8.9 要求 Python 3.12+,内置 Web companion 为 `0.3.21`。
下表介绍本版本能力;安装前核对 GitHub Release 与两个 PyPI 发行包的版本。

[0.8.8 升级指南](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/upgrade-0-8-8/)说明 Tunnel 迁移、Memory 历史兼容、依赖选择和聊天传输配置。正式 GitHub Release 发布前,0.8.8 仍为候选,评估时使用经过审核的 wheel。
[0.8.8 升级指南](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/upgrade-0-8-8/)说明 Tunnel 迁移、Memory 历史兼容、依赖选择和聊天传输配置。0.8.9 新增长会话快照分页与内容分块、模型上下文压缩和多知识库检索,并修复 OAuth 恢复竞态;既有聊天、Tunnel、AG-UI/A2UI、A2A 和 API Key MCP 接入继续保留。正式发布前,评估 0.8.9 请使用经过审核的候选 wheel。

| 能力 | 如何接入 |
| --- | --- |
Expand Down
4 changes: 2 additions & 2 deletions docs-site/app/[lang]/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ const copy = {
cn: {
title: "Kingsoft Cloud Agent Development Kit",
subtitle: "金山云智能体开发套件",
desc: "构建、部署、调试、观测企业级 AI 智能体的一站式云原生框架。0.8.8 以可信内核、Harness 执行层和可插拔 Provider 统一 Codex、ADK、LangGraph 等运行时。",
desc: "构建、部署、调试、观测企业级 AI 智能体的一站式云原生框架。0.8.9 以可信内核、Harness 执行层和可插拔 Provider 统一 Codex、ADK、LangGraph 等运行时。",
cta: "阅读文档",
ctaSecondary: "GitHub 仓库",
installLabel: "安装",
},
en: {
title: "Kingsoft Cloud Agent Development Kit",
subtitle: "Agent development kit for Kingsoft Cloud",
desc: "A cloud-native framework to build, deploy, debug, and observe enterprise AI agents. Version 0.8.8 unifies Codex, ADK, LangGraph, and other runtimes through a trusted kernel, Harness execution layer, and pluggable Providers.",
desc: "A cloud-native framework to build, deploy, debug, and observe enterprise AI agents. Version 0.8.9 unifies Codex, ADK, LangGraph, and other runtimes through a trusted kernel, Harness execution layer, and pluggable Providers.",
cta: "Read the docs",
ctaSecondary: "GitHub",
installLabel: "Install",
Expand Down
29 changes: 29 additions & 0 deletions docs-site/content/docs/framework/guides/memory-knowledge.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,32 @@ When adding a memory or knowledge example to the public repository:
<Callout type="warning">
Examples should use fake data or public sample data. Treat logs, traces, memory snapshots, uploaded files, and knowledge base records as potentially sensitive until reviewed.
</Callout>

## Multiple datasets in a resource binding

The 0.8.9 candidate supports up to nine additional datasets in one knowledge-base resource configuration. The primary dataset is binding.resource.id. Additional IDs must be unique; additionalRetrievals keys must belong to that list. Use customInstruction for dataset-specific retrieval guidance. This object belongs in the resource plugin config, not in model tool arguments. The deployment still supplies the connection and authentication. Omitting the new fields preserves the existing single-dataset configuration digest.

```json
{
"binding": {
"id": "knowledge",
"connectionRef": "configured-connection",
"resource": {
"kind": "knowledge-base",
"id": "dataset-main",
"region": "cn-beijing-6"
}
},
"retrieval": {
"customInstruction": "Search the primary documents."
},
"additionalDatasetIds": [
"dataset-extra"
],
"additionalRetrievals": {
"dataset-extra": {
"customInstruction": "Search the supplementary documents."
}
}
}
```
29 changes: 29 additions & 0 deletions docs-site/content/docs/framework/guides/memory-knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,32 @@ config:
</Callout>

完整变量列表见 [ksadk 环境变量参考](../../references/environment-variables.mdx)。

## 多知识库资源绑定

0.8.9 候选支持在一个 knowledge-base 资源配置中通过 `additionalDatasetIds` 添加最多 9 个 dataset。主 dataset 使用 `binding.resource.id`,附加 ID 不得重复;`additionalRetrievals` 的键必须来自附加列表,可用 `customInstruction` 提供各数据集的检索指引。此对象属于资源插件的 `config`,不作为模型工具参数传入;连接和鉴权仍由部署环境配置。省略新增字段时保留已有单知识库配置摘要。

```json
{
"binding": {
"id": "knowledge",
"connectionRef": "configured-connection",
"resource": {
"kind": "knowledge-base",
"id": "dataset-main",
"region": "cn-beijing-6"
}
},
"retrieval": {
"customInstruction": "Search the primary documents."
},
"additionalDatasetIds": [
"dataset-extra"
],
"additionalRetrievals": {
"dataset-extra": {
"customInstruction": "Search the supplementary documents."
}
}
}
```
14 changes: 14 additions & 0 deletions docs-site/content/docs/framework/guides/tool-tunnel.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ if __name__ == "__main__":

Replace the service addresses and operations with your own. Set `AGENT_URL` to the agent’s HTTPS gateway prefix and `GATEWAY_TOKEN` to its gateway bearer credential. Run `python connector.py`. The Connector selects WSS and appends the tunnel route. Supply any private service credentials in the corresponding `LocalMCPService` or `LocalAPIService` headers.

## TLS and trusted certificates

An HTTPS Agent URL uses WSS. The Connector verifies the certificate chain and hostname by default. For an enterprise CA, point Python's `SSL_CERT_FILE` to a trusted CA file. The server should provide its complete certificate chain.

macOS and Windows applications can also use the system trust store. Install `truststore` and run this at the Connector application entry point, before importing HTTP/WebSocket libraries:

```python
import truststore

truststore.inject_into_ssl()
```

Certificate-chain and hostname verification remain enabled. For `unable to get local issuer certificate`, check the CA configuration and the server's intermediate certificates.

## Tool visibility and multiple Pods

- The enterprise Connector enforces `tool_filter` on each MCP tool call. The cloud runtime receives the MCP catalog and filters the tools presented to the model. To keep tool names, descriptions or parameter schemas private, restrict the enterprise MCP server’s `tools/list` response.
Expand Down
Loading
Loading