Repository navigation
Commit 0f47bdc
authored
feat(harness): deployable Harness server +
* feat(harness): accept a runtime parameter (adk default, codex)
The Harness model now carries a `runtime` field (Literal["adk","codex"],
default "adk") passed through to the Agent, so a deployed Harness server can
run an agent on the codex runtime. Exposed on the CLI via `--runtime` on both
`harness add` and `harness invoke` (one-time override). Docs + example updated.
* feat(harness): add deployable harness_app package and `veadk harness` CLI
- veadk/cloud/harness_app/: env-assembled agent + FastAPI harness server
(/harness/invoke with clone-based once-time overrides; incremental,
deduped tools/skills; per-invoke skill temp-dir cleanup)
- veadk harness create/deploy/invoke; deploy builds the image via AgentKit
and creates an AgentKit runtime (Name=HARNESS_NAME, tag "Harness")
- invoke override flags are generated from HarnessOverrides
- replaces the single-file veadk/cloud/harness_app.py
* feat(harness): layered harness.yaml config + env_mapping; redesign create/add/deploy
- harness.yaml (layered, per-component) is the agent spec; env_mapping.to_runtime_env
reuses veadk flatten_dict for generic fields and maps each component's backend
connection params to the veadk DATABASE_* env vars the backend reads
- veadk harness create/add/deploy: create scaffolds harness.yaml + .env.example
(AK/SK only) + domestic-source Dockerfile; add edits harness.yaml; deploy builds
the image on AgentKit cloud and creates a runtime via sdk.launch
- runtime env names aligned (MODEL_NAME / KNOWLEDGE_BASE_TYPE / LONG_TERM_MEMORY_TYPE
/ SHORT_TERM_MEMORY_TYPE)
* feat(harness): full-commented harness.yaml template; deploy prints apikey + invoke cmd; add --path takes a dir
- create's harness.yaml now documents every component's supported backends and
their connection params as comments (uncomment for your chosen type)
- deploy surfaces the created runtime's id / endpoint / api key and a ready-to-run
invoke command (from the deploy result's config_updates)
- harness add --path now takes the harness directory (consistent with deploy);
setting a component type preserves its existing connection params
* fix(harness): read deploy runtime apikey/endpoint from deploy_result.metadata
* feat(harness): 'harness add --set KEY=VALUE' writes nested params into harness.yaml
Lets users fill backend connection params from the CLI, e.g.
veadk harness add --long-term-memory-type viking \
--set long_term_memory.project=my-proj --set long_term_memory.region=cn-beijing
Values are parsed as YAML scalars (ints/bools stay typed); deploy maps them to
the veadk DATABASE_* env vars.
* feat(harness): explicit per-component connection flags for 'harness add'
Replace the generic '--set KEY=VALUE' with explicit flags in the same style as
'--short-term-memory-type', e.g. --long-term-memory-project, --short-term-memory-host.
Flags are auto-generated from env_mapping.COMPONENT_BACKENDS so they stay in sync
with the backends; values are written under the matching component section and
mapped to the veadk DATABASE_* env vars on deploy.
* feat(harness): unify add/invoke flags, knowledgebase rename, cleaner harness.yaml
- add reuses invoke's HarnessOverrides-generated flags (--model-name/--tools/
--skills/--system-prompt/--runtime identical in both); --tools/--skills are
comma-separated; --name (alias --harness-name) for the harness name; invoke
also accepts --name
- rename component knowledge_base -> knowledgebase (env KNOWLEDGEBASE_TYPE)
- add writes connection params via explicit --<component>-<param> flags
- add output: inline-style lists, and drop unset components (knowledgebase /
long_term_memory); short_term_memory always shown
- create's harness.yaml annotates each field with its env var + add flag
- register demo tools (get_city_weather / get_location_weather) as built-ins
* feat(harness): deploy records harness.json; invoke resolves url/key from it + --message
- deploy writes/updates ./harness.json: {name: {url, key, runtime_id}}
- invoke takes --name (reads url/key from harness.json), --message/-m (or positional);
--url/--key optional overrides; --path for harness.json location
* feat(harness): add 'veadk harness show' (configured agent params + overridable flags)
* docs(harness): rewrite CLI reference for current create/add/show/deploy/invoke flow
The reference still described the removed server-side `/harness/add` registration
and the old `--harness/--url/--key` invoke design. Rewrite it around the current
`veadk harness` flow: layered harness.yaml (knowledgebase/KNOWLEDGEBASE_TYPE),
comma-separated --tools/--skills, per-component connection flags, deploy writing
harness.json, and invoke resolving url/key by --name.
* test(harness): fix contract tests for redesigned harness_app API
The contract tests still imported the removed `/harness/add` design
(`AddHarnessRequest`/`AddHarnessResponse`/`Harness`/`_split_csv`), so the module
failed to import. Rewrite against the current schemas: HarnessOverrides (per-call
overridable) vs HarnessConfig (creation-time, with memory/kb), the InvokeHarness
request/response models, and split_csv.
* refactor(harness): remove dead 'veadk agentkit harness add' command
The server (harness_app) no longer exposes /harness/add — agents are assembled
from env at deploy time, not registered at runtime — so the client 'add' command
posted to a route that 404s. Remove it (and its contract tests); keep the working
'invoke' client and the shared _harness_request helper.
* docs(examples): rewrite #14 harness example for the veadk harness flow
The example documented the removed /harness/add registration, the old
`agentkit config --entry_point ...` deploy flow, and `python -m
veadk.cloud.harness_app` (now a package, no __main__). Rewrite both READMEs
around create -> add -> deploy -> invoke with harness.json, and drop the
orphaned .env.example / requirements.txt (the scaffold is now generated by
`veadk harness create`).
* feat(harness): add OAuth2/JWT (custom_jwt) deploy option
An `auth` block in harness.yaml (or --discovery-url / --allowed-id on deploy)
switches the runtime gateway to custom_jwt: it admits only JWTs issued by the
user pool at `discovery_url` whose audience is in `allowed_ids`. Absent an
`auth` block, deploy keeps the existing key_auth path unchanged.
The auth block is excluded from the flattened runtime env (it configures the
gateway authorizer, not the container). No secret is involved — the user pool /
client / external IdP are set up in the Volcengine Identity console and the CLI
only references discovery_url + allowed_ids. custom_jwt deploys record
{url, runtime_id, auth_type, discovery_url, allowed_ids} in harness.json.
Verified end-to-end against a real user pool: deploy -> runtime Ready with a
custom_jwt authorizer carrying the given discovery_url + allowed_clients, no
key_auth. Docs (zh/en) updated.veadk harness CLI (create/add/show/deploy/invoke), with OAuth2/JWT deploy (#603)1 parent b7038b8 commit 0f47bdc
20 files changed
Lines changed: 2231 additions & 702 deletions
File tree
- docs/content/docs/cli
- examples/14_harness_server_on_agentkit
- tests
- cli
- cloud
- veadk
- cli
- cloud
- harness_app
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
12 | 9 | | |
13 | 10 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 11 | + | |
17 | 12 | | |
18 | 13 | | |
19 | | - | |
| 14 | + | |
20 | 15 | | |
21 | 16 | | |
22 | 17 | | |
23 | | - | |
24 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
25 | 23 | | |
26 | | - | |
| 24 | + | |
27 | 25 | | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
36 | 60 | | |
37 | | - | |
| 61 | + | |
38 | 62 | | |
39 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
40 | 66 | | |
41 | 67 | | |
42 | | - | |
| 68 | + | |
| 69 | + | |
43 | 70 | | |
44 | 71 | | |
45 | 72 | | |
46 | 73 | | |
47 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
48 | 133 | | |
49 | 134 | | |
50 | 135 | | |
51 | 136 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
62 | 145 | | |
63 | | - | |
| 146 | + | |
64 | 147 | | |
65 | | - | |
66 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
67 | 185 | | |
68 | 186 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 187 | + | |
73 | 188 | | |
74 | 189 | | |
| 190 | + | |
| 191 | + | |
75 | 192 | | |
76 | 193 | | |
77 | | - | |
78 | | - | |
| 194 | + | |
| 195 | + | |
79 | 196 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
85 | 206 | | |
86 | | - | |
| 207 | + | |
87 | 208 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 209 | + | |
92 | 210 | | |
93 | 211 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
99 | 215 | | |
100 | 216 | | |
101 | 217 | | |
102 | 218 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 219 | + | |
0 commit comments