build: move the claw to rhema 0.3.0
android / debug (push) Successful in 2m51s
android / release (push) Successful in 2m37s
ci / checks (push) Successful in 1m32s
ci / test (push) Successful in 1m0s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 1m33s
ci / web (push) Successful in 13s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m32s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 14s
ci / publish-edge-chart (push) Successful in 4s

The framework releases 0.3.0, so every rhema dependency moves with it: the workspace version, the daemon's crates, and the two integrations. The only new transitive package is webpki-roots, pulled by the provider crates' TLS stack.

The agent constructors changed shape. CodingAgentConfig::new takes the provider, model, workspace, and approval, and keeps both handles: CodingAgent::new and CodingAgent::from_session take the config alone, and turn no longer takes an approval argument. The claw's forge and job paths build one config each and pass AllowAll there, the policy every turn ran under before.

The vision and mcp tests build their config through the same constructor, so they hand it a MockProvider.

fmt, clippy with -D warnings, the workspace tests, and a locked check pass.
This commit is contained in:
vhaudiquet committed 2026-11-18 20:25:22 +01:00
1 parent c56f544993
commit 68671c76ce
9 files changed
+104 -75

No files matched your search

+13 -13
View File
@@ -27,28 +27,28 @@ mock = ["rhema-core/mock"]
[dependencies]
# The shared toolkit: the resident agent assembles its agent from the
# shell, the approval seam, paste expansion, and revive-on-resume
rhema-agent-tools = "0.2.3"
rhema-autonomous-agent = "0.2.3"
rhema-coding-agent = "0.2.3"
rhema-config = "0.2.3"
rhema-core = "0.2.3"
rhema-agent-tools = "0.3.0"
rhema-autonomous-agent = "0.3.0"
rhema-coding-agent = "0.3.0"
rhema-config = "0.3.0"
rhema-core = "0.3.0"
# The bounded request view over the claw sessions, on by default here
rhema-transcript = "0.2.3"
rhema-transcript = "0.3.0"
rhema-calendar-integration = { path = "../../integrations/rhema-calendar-integration" }
rhema-forge-integration = { path = "../../integrations/rhema-forge-integration" }
# The accounts layer: identities hold the forge tokens the watches poll
# with, and the identity tools manage them over chat
rhema-identity = "0.2.3"
rhema-rsd = "0.2.3"
rhema-identity = "0.3.0"
rhema-rsd = "0.3.0"
# The tool contract: the agent-token allowlist and version the auth
# middleware enforces (rhema-tools spec). The arrow runs claw ->
# contract only — never the reverse.
rhema-claw-tools-contract = { path = "../../tools/contract" }
# The resident tier's durable memory: its tools join the resolver chain
rhema-memory = "0.2.3"
rhema-memory = "0.3.0"
# The shared ModelCard the backend registry's listings return
rhema-provider = "0.2.3"
rhema-provider-registry = "0.2.3"
rhema-provider = "0.3.0"
rhema-provider-registry = "0.3.0"
# Args for the two-flag binary surface
clap = { version = "4.5", features = ["derive"] }
serde = { workspace = true }
@@ -71,7 +71,7 @@ time = { version = "0.3", default-features = false, features = ["parsing"] }
# Inbound chat images ride base64; the dispatch decodes them into the
# attachment store
base64 = "0.22"
rhema-mcp = "0.2.3"
rhema-mcp = "0.3.0"
[dev-dependencies]
tempfile = "3"
@@ -83,7 +83,7 @@ reqwest = { version = "0.12", features = ["json", "stream"] }
bytes = "1"
# The scripted provider for turn-level tests; mirrors rhema-code's mock
# feature without a feature of our own — tests are the only consumer
rhema-core = { version = "0.2.3", features = ["mock"] }
rhema-core = { version = "0.3.0", features = ["mock"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "sync", "time"] }
[lints]
+14 -8
View File
@@ -283,7 +283,7 @@ impl ClawHandler {
let prompt = build_prompt(&key, &snapshot, &news, workspace.as_path(), role);
let mut sink = TurnSink;
let output = agent
.turn(prompt, &mut sink, Arc::new(AllowAll))
.turn(prompt, &mut sink)
.await
.map_err(|err| format!("turn for {key} failed: {err}"))?;
@@ -332,14 +332,14 @@ impl ClawHandler {
key: &str,
) -> Result<CodingAgent, String> {
let (provider, model) = self.backends.current();
let config = self.agent_config(&model, workspace);
let config = self.agent_config(provider, &model, workspace);
let agent = match &ctx.session.core.driver_state {
// A never-dispatched key carries no stash: start clean.
serde_json::Value::Null => CodingAgent::new(provider, config),
serde_json::Value::Null => CodingAgent::new(config),
stashed => {
let session: Session = serde_json::from_value(stashed.clone())
.map_err(|err| format!("stashed session for {key} does not parse: {err}"))?;
CodingAgent::from_session(provider, config, session)
CodingAgent::from_session(config, session)
}
};
agent.map_err(|err| format!("cannot start the coding agent for {key}: {err}"))
@@ -349,8 +349,13 @@ impl ClawHandler {
/// agent's, with the bounded request view when the config has it on.
/// A forge thread answers for as long as the thread lives; without
/// the view its history would ride whole on every step.
fn agent_config(&self, model: &str, workspace: &Path) -> CodingAgentConfig {
let mut config = CodingAgentConfig::new(model, workspace);
fn agent_config(
&self,
provider: Arc<dyn rhema_core::ModelProvider>,
model: &str,
workspace: &Path,
) -> CodingAgentConfig {
let mut config = CodingAgentConfig::new(provider, model, workspace, AllowAll);
// Write the resolved value, not an override: the coding agent's
// own default is on now, and the config's `false` must win.
config.transcript = self
@@ -1221,6 +1226,7 @@ mod tests {
.expect("constructs"),
);
let accounts = Arc::new(rhema_identity::VolatileIdentityStore::new());
let provider = registry.current().0;
let on = ClawHandler::new(
registry.clone(),
"/tmp/w",
@@ -1238,12 +1244,12 @@ mod tests {
std::collections::BTreeMap::new(),
);
assert!(
on.agent_config("m", Path::new("/tmp/w"))
on.agent_config(provider.clone(), "m", Path::new("/tmp/w"))
.transcript
.is_some()
);
assert!(
off.agent_config("m", Path::new("/tmp/w"))
off.agent_config(provider, "m", Path::new("/tmp/w"))
.transcript
.is_none()
);
+4 -4
View File
@@ -212,7 +212,7 @@ impl CodingJobHandler {
.map_err(|err| format!("job {job_id} could not start: {err}"))?;
let (provider, model) = self.backends.current();
let mut config = CodingAgentConfig::new(model, &workspace);
let mut config = CodingAgentConfig::new(provider, model, &workspace, AllowAll);
config.max_turn_steps = self.max_turn_steps;
// A job's stashed session carries across runs and only ever
// grows; the view is what keeps a repeat run's steps cheap.
@@ -236,9 +236,9 @@ impl CodingJobHandler {
self.fail(job_id, &instance_name, &reason);
reason
})?;
CodingAgent::from_session(provider, config, session)
CodingAgent::from_session(config, session)
}
None => CodingAgent::new(provider, config),
None => CodingAgent::new(config),
}
.map_err(|err| {
let reason = format!("cannot start the coding agent for {instance_name:?}: {err}");
@@ -253,7 +253,7 @@ impl CodingJobHandler {
agent.set_commit_hook(Some(ctx.commit_hook()));
let mut sink = JobSink;
let output = match agent.turn(&job.prompt, &mut sink, Arc::new(AllowAll)).await {
let output = match agent.turn(&job.prompt, &mut sink).await {
Ok(output) => output,
Err(err) => {
let reason = format!("the coding turn for {instance_name:?} failed: {err}");
+6 -1
View File
@@ -82,7 +82,12 @@ mod tests {
/// same map).
#[test]
fn apply_without_any_wiring_leaves_the_config_alone() {
let mut config = CodingAgentConfig::new("m", std::path::Path::new("/tmp"));
let mut config = CodingAgentConfig::new(
rhema_core::mock::MockProvider::new([]),
"m",
std::path::Path::new("/tmp"),
rhema_agent_tools::AllowAll,
);
let before = config.shell_env.clone();
apply(&mut config);
// The wiring only appears when the machine's global mcp.yaml
+6 -1
View File
@@ -52,7 +52,12 @@ mod tests {
/// values are constants, so extending twice is the same map.
#[test]
fn apply_twice_is_apply_once() {
let mut config = CodingAgentConfig::new("m", std::path::Path::new("/tmp"));
let mut config = CodingAgentConfig::new(
rhema_core::mock::MockProvider::new([]),
"m",
std::path::Path::new("/tmp"),
rhema_agent_tools::AllowAll,
);
apply(&mut config);
let once = config.shell_env.clone();
apply(&mut config);