fix(agents): add return type annotation on retain closure; trim canSubmit comment

Add explicit -> Result<(), String> annotation on the retain callback closure in
retain_failure_after_persist_is_returned_not_swallowed — clippy cannot infer the
Ok type from Err alone.

Compress canSubmit credential-gate comment from 5 lines to 2 to clear the
AgentEditMergedDialog.tsx file-size ratchet (was 1001 wc-l → now 998).

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
Duncan
2026-08-29 13:48:39 -04:00
parent 4aaf2c6f26
commit ce3eb7694d
2 changed files with 5 additions and 9 deletions

View File

@@ -337,7 +337,7 @@ async fn retain_failure_after_persist_is_returned_not_swallowed() {
let result = update_persona_with(
update_request("p1", "Alice retain-fail", Some(R1)),
app.handle().clone(),
|_app, _state, _persona| {
|_app, _state, _persona| -> Result<(), String> {
Err("simulated retain / publish failure after persona persisted".to_string())
},
)

View File

@@ -558,11 +558,8 @@ export function AgentEditMergedDialog({
!isAvatarUploadPending &&
displayName.trim().length > 0 &&
providerValid &&
// D-side credential gate: whenever the definition is editable, its required
// credential keys must be satisfied — independent of the instance gate, so a
// linked instance pin can't unblock a definition that main would reject.
// Team-managed definitions (defReadOnly) never block: the user can't change
// their credentials, so their readiness is not this form's concern.
// D-side credential gate: required keys must be satisfied when the definition
// is editable. Team-managed (defReadOnly) never blocks — user can't change them.
(!showDef || defReadOnly || !dAdvanced.requiredEnvKeyMissing) &&
(showInst
? !requiredEnvKeyMissing &&
@@ -570,9 +567,8 @@ export function AgentEditMergedDialog({
(selectedRuntimeId !== "custom" ||
inheritHarness ||
agentCommand.trim().length > 0) &&
// Instance name must be non-blank when the name field controls submission
// (no name pool — pool-named instances get their names from the definition
// pool and do not submit the visible name field).
// Block submission when the instance name field controls the name and
// the user has left it blank (no name pool — pool-named instances skip).
((def?.namePool?.length ?? 0) > 0 || instanceName.trim().length > 0)
: true);