feat(app): start a pipeline from the detail view

Native Run action opens the web's prompt/workspace/notify dialog, sends the exact run_pipeline body against the pinned resolved version with one request key per confirmed attempt, keeps refusals in the dialog, reconciles a lost reply by key, and opens only the server-named run through the existing run route with one fresh Runs list read.

Adds a shared failure-reason helper so operators never see Dart runtime prefixes, and records the slice boundary in notes/P3-run.md.
This commit is contained in:
2026-10-22 02:07:49 +01:00
parent 92706a290e
commit 53a8f668ca
24 changed files with 2644 additions and 19 deletions
+26
View File
@@ -0,0 +1,26 @@
/// The reason text carried by a failed request, without runtime diagnostics.
///
/// The gateway fails pending requests with `StateError('Connection closed')`,
/// whose `toString()` is `Bad state: Connection closed`. The browser shows the
/// reason itself, never a Dart diagnostic, so those prefixes are stripped while
/// deliberate protocol/refusal messages stay untouched. [fallback] is the
/// honest sentence for a failure that carries no text at all.
String describeErrorReason(
Object error, {
required String fallback,
}) {
final raw = switch (error) {
StateError(:final message) => message.toString(),
_ => '$error',
};
var message = raw.trim();
for (final prefix in _runtimePrefixes) {
if (message.startsWith(prefix)) {
message = message.substring(prefix.length).trim();
}
}
return message.isEmpty ? fallback : message;
}
/// Dart runtime prefixes that never belong in operator-facing copy.
const _runtimePrefixes = ['Bad state:', 'Exception:'];