Skip to content
Merged
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.22"
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.22"
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.22"
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.22"
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.22' }}
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.22"
run: make build-frontend

- name: Verify clean release source
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,37 @@
格式参考 [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 拒绝后重新授权时完成回执早于状态快照到达的竞态,保留较新回执等待下一次状态确认,避免丢失恢复唤醒;保持旧回执、签名、会话归属及工具副作用去重校验。
- OAuth 端点路径遵循经过 issuer、HTTPS 和同源校验的服务方元数据,兼容带资源路径的授权地址;本地重新授权和 token 刷新会更新元数据、复用注册客户端,并按事务快照处理回调,保留资源、PKCE 与回调归属校验。

### 资源、界面与文档

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

### 依赖

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

## [0.8.8]

### 新增与修复
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -404,17 +404,22 @@ 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
PUBLIC_TEST_TARGETS += tests/test_mcp_oauth_local.py
PUBLIC_TEST_TARGETS += tests/test_mcp_oauth_metadata.py tests/test_mcp_oauth_runtime_io.py
PUBLIC_TEST_TARGETS += tests/test_mcp_oauth_platform.py
PUBLIC_TEST_TARGETS += tests/runners/test_langgraph_model_context.py::test_text_hook_cannot_drop_sdk_attachment_or_mutate_shared_messages
PUBLIC_TEST_TARGETS += tests/test_mcp_oauth_catalog.py tests/test_mcp_oauth_extension.py tests/test_mcp_oauth_transport.py
PUBLIC_TEST_TARGETS += tests/test_mcp_oauth_documented_graph.py
PUBLIC_TEST_TARGETS += tests/a2a/test_workload_token_public_compat.py
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 +625,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.22`.
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.22`。
下表介绍本版本能力;安装前核对 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.22`。
下表介绍本版本能力;安装前核对 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
15 changes: 15 additions & 0 deletions docs-site/content/docs/framework/guides/mcp-oauth.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ Install an SDK containing this capability and the LangGraph dependencies, such a
and configure your model. Hosted use also requires the platform to enable a compatible Broker,
Kernel, and workload projection; installing the SDK does not enable those platform services.

## Authorization discovery and endpoint updates

The SDK discovers the authorization server through MCP protected-resource metadata and uses its
`authorization_endpoint`, `token_endpoint`, `registration_endpoint`, and `revocation_endpoint`
after validating the issuer, HTTPS, and origin. Endpoint paths belong to the provider's metadata.
Do not hardcode paths such as `/oauth/authorize` or infer MCP resource ownership from an authorization
server path. Resource, scope, redirect URI, and PKCE checks remain independent.

Local authorization opens and token refreshes rediscover metadata while reusing the registered client.
Each authorization transaction retains its own metadata snapshot. If metadata changes when authorization
is reopened, the pending transaction is cancelled and a new link uses a new transaction; callbacks do
not use metadata refreshed for a later transaction. No new environment variable or credential-vault
reset is required. Hosted use requires a compatible platform Broker that also accepts the provider's
published endpoints; upgrading the SDK does not replace the platform's protocol implementation.

## Integrate a caller-owned graph

Define your existing asynchronous LangChain chat model as `model` in the entry module, then add this graph.
Expand Down
12 changes: 12 additions & 0 deletions docs-site/content/docs/framework/guides/mcp-oauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ MCP OAuth 是显式接入的 LangGraph 能力。服务声明只包含连接地
本地项目需要安装包含此能力的 SDK 和 LangGraph 依赖,例如 `ksadk[langgraph,agui]`,并配置自己的模型。
托管模式还需要平台启用兼容 Broker、Kernel 与工作负载投射;SDK 安装成功不代表平台已启用这些能力。

## 授权服务发现与端点更新

SDK 根据 MCP 受保护资源元数据发现授权服务,使用通过 issuer、HTTPS 和同源校验的
`authorization_endpoint`、`token_endpoint`、`registration_endpoint` 与 `revocation_endpoint`。
端点路径由服务方元数据决定,不要在项目中硬编码 `/oauth/authorize` 等路径,也不要把授权服务的
路径当作 MCP 资源归属;资源、作用域、回调地址和 PKCE 仍独立校验。

本地重新打开授权或刷新 token 时会重新发现元数据,复用已注册的客户端;每次授权事务保存自己的
元数据快照。若重新打开时元数据变化,旧的待授权事务取消,新链接对应新的事务,回调不会错误地
使用后续刷新的元数据。无需新增环境变量,也无需清空本地凭据库。托管模式需要配套平台 Broker
同样支持服务方公布的端点;只升级 SDK 不会替换平台的协议实现。

## 接入自有图

在入口模块中先定义现有的异步 LangChain 聊天模型 `model`,再加入下面的图。
Expand Down
Loading
Loading