Skip to content

feat(api): cancel interpretation runs via loopback cancel CLI - #442

Closed
seonghobae wants to merge 1 commit into
feat/interpretation-run-cancel-http-gap-003afrom
feat/interpretation-run-cancel-cli-gap-003a
Closed

feat(api): cancel interpretation runs via loopback cancel CLI#442
seonghobae wants to merge 1 commit into
feat/interpretation-run-cancel-http-gap-003afrom
feat/interpretation-run-cancel-cli-gap-003a

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

GAP-003A unique slice stacked on #440: published tepp-interpretation-run-cancel cancel mints typed contextual_orchestrator_interpretation_run_cancel_exchange onto spawned tepp-orchestrator-loopback TCP so operators do not write HTTP by hand.

Test plan

  • cargo test -p orchestrator_live
  • cargo clippy -p orchestrator_live --all-targets -- -D warnings
  • cargo doc -p orchestrator_live --no-deps
  • python3 scripts/validate_documentation.py
  • python3 scripts/check_docstrings.py
  • Independent exact-head review (not author, not Copilot, not Devin/CodeRabbit COMMENTED)

Devin Review

GAP-003A unique slice stacked on cancel HTTP: published
tepp-interpretation-run-cancel cancel mints typed
contextual-orchestrator POST /v1/interpretation-runs/{key}/cancel
onto spawned tepp-orchestrator-loopback TCP. Naruon and
LineageWeave refused. ADR 0074.
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 37631387-fb0c-454c-9fcf-26167fa268b4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment on lines +292 to +295
let exchange = contextual_orchestrator_interpretation_run_cancel_exchange(
&invocation.origin,
&invocation.idempotency_key,
)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Long accepted runs cannot be cancelled

For accepted keys over 128 bytes, contextual_orchestrator_interpretation_run_cancel_exchange rejects cancellation before sending the request. Those runs remain registered.

Prompt for agents
Align interpretation-run creation and cancellation identity limits. InterpretationRunRequest validation currently accepts idempotency keys longer than INTERPRETATION_RUN_CANCEL_ID_MAX_LEN, while compose_interpretation_run_cancel_cli_http delegates to contextual_orchestrator_interpretation_run_cancel_exchange, which rejects keys over 128 bytes. Either enforce the same limit when creating runs, with compatibility consideration for existing accepted identities, or extend cancel path handling so every valid created key remains cancellable. Add an end-to-end test covering the boundary and an over-128-byte key.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +12 to +33
fn main() -> ExitCode {
match run() {
Ok(()) => ExitCode::SUCCESS,
Err(_) => ExitCode::FAILURE,
}
}

fn run() -> Result<(), OrchestratorLiveError> {
let args: Vec<String> = std::env::args().skip(1).collect();
match args.first().map(String::as_str) {
Some("cancel") => run_cancel(&args),
_ => Err(OrchestratorLiveError::InvalidWirePayload),
}
}

fn run_cancel(args: &[String]) -> Result<(), OrchestratorLiveError> {
let body = read_interpretation_run_cancel_cli_stdin(io::stdin().is_terminal(), io::stdin())?;
let invocation = InterpretationRunCancelCliInvocation::from_args(args, body)?;
let response = execute_interpretation_run_cancel_cli(&invocation)?;
let stdout = render_interpretation_run_cancel_cli_stdout(&invocation, &response)?;
println!("{stdout}");
Ok(())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Binary behavior lacks direct coverage

Tests call library functions but never launch tepp-interpretation-run-cancel. Its command dispatch, exit status, stdin, and stdout paths remain uncovered.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Closing with replacement mapping to #174. This CLI only transports #440's unauthenticated destructive mutation; refusing credential-shaped CLI flags does not create an authorization boundary. Preserve CLI parsing/framing/stdout/refusal tests for the future authenticated contextual-orchestrator operations adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant