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
12 changes: 11 additions & 1 deletion apps/decodex/src/agent/tracker_tool_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,20 @@ struct TransitionArgs {
}

#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
struct CommentArgs {
#[serde(flatten)]
scope: ScopeArgs,
body: String,
kind: String,
error_class: Option<String>,
next_action: Option<String>,
#[serde(default)]
blockers: Vec<String>,
#[serde(default)]
evidence: Vec<String>,
failed_command: Option<String>,
raw_error: Option<String>,
summary: Option<String>,
}

#[derive(Debug, Deserialize)]
Expand Down
13 changes: 13 additions & 0 deletions apps/decodex/src/agent/tracker_tool_bridge/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::{
process::{self, Command},
};

use serde_json::Value;
use tempfile::TempDir;

use crate::{
Expand Down Expand Up @@ -444,6 +445,18 @@ fn sample_review_context() -> ReviewHandoffContext {
}
}

fn manual_attention_comment_args() -> Value {
serde_json::json!({
"kind": "manual_attention",
"error_class": "operator_decision_required",
"next_action": "resolve the blocker manually, clear the needs-attention label, then restart automation if desired",
"blockers": ["operator decision is required before automation can continue"],
"evidence": ["agent selected the manual-attention path for this run"],
"failed_command": "cargo make test",
"raw_error": "repo gate failed with public test output"
})
}

fn sample_review_context_in(cwd: &Path) -> ReviewHandoffContext {
ReviewHandoffContext {
attempt_number: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@ fn completion_disposition_allows_manual_attention_exit_without_review_handoff()
let comment_response = DynamicToolHandler::handle_call(
&bridge,
ISSUE_COMMENT_TOOL_NAME,
serde_json::json!({ "body": "Blocked on missing tracker permission; handing off for manual repair." }),
manual_attention_comment_args(),
);

assert!(response.success);
assert!(comment_response.success);

let comment = tracker.comments.borrow().first().expect("manual attention comment should write").clone();
let record = records::parse_linear_execution_event_record(&comment)
.expect("manual attention comment should include a ledger record");

assert_eq!(record.event_type, "needs_attention");
assert_eq!(record.error_class.as_deref(), Some("operator_decision_required"));
assert_eq!(record.terminal_path.as_deref(), Some("manual_attention"));
assert_eq!(
bridge.completion_disposition().expect("manual attention should be accepted"),
RunCompletionDisposition::ManualAttention
Expand Down
Loading