An OpenAI Codex agent calls persistent R through ducknng
Source:vignettes/agent-product-path.Rmd
agent-product-path.RmdThis is the authored source for a precomputed vignette. The agent
starts the local R adapter, receives its NNG URL, discovers methods from
the endpoint’s ducknng RPC manifest, and invokes those methods through
fresh DuckDB clients. The committed .Rmd preserves the
result for package and pkgdown builds.
pi --model gpt-5.4 -e ./extensions/pi-ducknng/index.ts -p \
"Using the package tools, start the R adapter and follow " \
"its ducknng manifest. Evaluate and persist `mpg_by_cyl " \
"<- aggregate(mpg ~ cyl, data = datasets::mtcars, FUN = " \
"mean)`, returning the table. In a fresh call, use " \
"`mpg_by_cyl` to return `transform(mpg_by_cyl, " \
"delta_from_4cyl = mpg - mpg[cyl == 4])`. Close the " \
"endpoint. Report the manifested methods, endpoint " \
"process identity, and decoded rows, beginning with " \
"`AGENT_VERIFIED_MTCARS_PERSISTENCE` only when both calls " \
"and close succeed."AGENT_VERIFIED_MTCARS_PERSISTENCE
- Endpoint URL:
tcp://127.0.0.1:41205- Endpoint process:
PID 63619- Manifested methods:
eval: persistent-process R eval, JSON request → Arrow responseclose: persistent-process shutdown, JSON request → JSON responseFirst
evaldecoded rows (mpg_by_cyl): -4, 26.663636363636364-6, 19.742857142857144-8, 15.1Second fresh
evaldecoded rows (transform(...)): -4, 26.663636363636364, 0-6, 19.742857142857144, -6.92077922077922-8, 15.1, -11.563636363636364Close result: -
closed: trueThis verified that
mpg_by_cylpersisted across fresh RPC calls to the same endpoint process.