feat(workbench): live selection smoke, F02 agent e2e, DocumentView CLI
Hoist llm.ask prompt binding to avoid elevated `p`; prefer reasoning_content when content is empty; point live/tests at in-tree MARQDO_EXT; add USTC live gates and mock agent.step selection+resume evidence; view document --out for read-only browser embed checks. Design stays Partial (not Verified). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8cf5288481
commit
c7c329341b
8 files changed
+467
-5
No files matched your search
@@ -0,0 +1,81 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: workbench F02 agent selection (mock upstream)
|
||||
description: >-
|
||||
Explicit llm.create selection must drive agent.step; process env default model
|
||||
must not win. Upstream URL/key/model come from env set by the Rust harness.
|
||||
import:
|
||||
llm: ext/ai/llm.mq.md
|
||||
agent: ext/ai/agent.mq.md
|
||||
sys: lib/sys.mq.md
|
||||
json: lib/json.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**base = > sys.env_get name="OPENAI_BASE_URL"**
|
||||
**key = > sys.env_get name="OPENAI_API_KEY"**
|
||||
**mdl = > sys.env_get name="OPENAI_MODEL"**
|
||||
1. not `base`
|
||||
> print text=missing-OPENAI_BASE_URL
|
||||
> sys.exit code=2
|
||||
2. *
|
||||
**_ = 1**
|
||||
1. not `key`
|
||||
> print text=missing-OPENAI_API_KEY
|
||||
> sys.exit code=2
|
||||
2. *
|
||||
**_ = 1**
|
||||
1. not `mdl`
|
||||
> print text=missing-OPENAI_MODEL
|
||||
> sys.exit code=2
|
||||
2. *
|
||||
**_ = 1**
|
||||
|
||||
Poison ambient default — selection on the handle must still win at the plugin.
|
||||
> sys.env_set name="OPENAI_MODEL" value="env-poison-model"
|
||||
|
||||
**model = > llm.create model=`mdl` base_url=`base` api_key=`key` backend="openai-compatible" name=f02-agent**
|
||||
|
||||
`tools` =
|
||||
|
||||
| 工具 |
|
||||
|------|
|
||||
|
||||
**ag = > agent.agent model=`model` tools=`tools` standing="F02 selection probe; answer with one word only"**
|
||||
**step = > `ag`.step task="Reply with exactly one English word pong" writeback=False max_reads=1**
|
||||
**st = > json.get value=`step` key="status"**
|
||||
**ans = > json.get value=`step` key="result"**
|
||||
1. not `ans`
|
||||
**ans = > json.get value=`step` key="answer"**
|
||||
2. *
|
||||
**_ = 1**
|
||||
1. not `ans`
|
||||
**ans = > json.get value=`step` key="text"**
|
||||
2. *
|
||||
**_ = 1**
|
||||
|
||||
> print text=`st`
|
||||
> print text=`ans`
|
||||
|
||||
**dir = ".marqdo/workbench-f02-resume"**
|
||||
**saved = > agent.resume_save id="f02-sel" goal="pong" status="running" round=1 resume_dir=`dir`**
|
||||
**ok = > json.get value=`saved` key="ok"**
|
||||
1. `ok`
|
||||
> print text=resume-save-ok
|
||||
2. *
|
||||
> print text=resume-save-fail
|
||||
> print text=`saved`
|
||||
> sys.exit code=1
|
||||
|
||||
**loaded = > agent.resume id="f02-sel" resume_dir=`dir`**
|
||||
**found = > json.get value=`loaded` key="found"**
|
||||
1. `found`
|
||||
> print text=resume-load-ok
|
||||
2. *
|
||||
> print text=resume-load-fail
|
||||
> print text=`loaded`
|
||||
> sys.exit code=1
|
||||
|
||||
> agent.resume_clear id="f02-sel" resume_dir=`dir`
|
||||
> print text=f02-agent-selection-ok
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
markup: occlusion
|
||||
title: workbench M01 live selection (USTC-compatible)
|
||||
description: Explicit ModelSelection via llm.create; no llm.llm. Credentials from process env only.
|
||||
import:
|
||||
llm: ext/ai/llm.mq.md
|
||||
sys: lib/sys.mq.md
|
||||
json: lib/json.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
**base = > sys.env_get name="OPENAI_BASE_URL"**
|
||||
**key = > sys.env_get name="OPENAI_API_KEY"**
|
||||
**mdl = > sys.env_get name="OPENAI_MODEL"**
|
||||
1. not `base`
|
||||
> print text=missing-OPENAI_BASE_URL
|
||||
> sys.exit code=2
|
||||
2. *
|
||||
**_ = 1**
|
||||
1. not `key`
|
||||
> print text=missing-OPENAI_API_KEY
|
||||
> sys.exit code=2
|
||||
2. *
|
||||
**_ = 1**
|
||||
1. not `mdl`
|
||||
**mdl = "qwen3.8-chat"**
|
||||
2. *
|
||||
**_ = 1**
|
||||
|
||||
**model = > llm.create model=`mdl` base_url=`base` api_key=`key` backend="openai-compatible" name=workbench-live**
|
||||
|
||||
**q = "Reply with exactly one English word pong"**
|
||||
**reply = > model.ask prompt=`q`**
|
||||
**text = > json.get value=`reply` key="text"**
|
||||
**usage = > json.get value=`reply` key="usage"**
|
||||
**pt = > json.get value=`usage` key="prompt_tokens"**
|
||||
|
||||
> print text=`text`
|
||||
1. `pt`
|
||||
> print text=usage-present
|
||||
2. *
|
||||
> print text=usage-unknown
|
||||
Reference in new issue
Block a user