Repository navigation
AI-Chat model selector never offers the PTY (agent-CLI) option, leaving provider:'pty' unreachable - #1619
Conversation
The selector's ModelSelection type omitted 'pty', so nothing could ever write provider: 'pty' onto an ai-chat node — the embedded-terminal AiChatPtySession view was fully built but unreachable. Adds an "Agent CLI" option that sets provider: 'pty' with no model; the specific harness is chosen later inside AiChatPtySession. Co-Authored-By: Claude <[email protected]>
Pragmatic Code Review — PR #1619Review Type: Initial Review Issue: #1489 — AI-Chat model selector never offers the PTY (agent-CLI) option Requirements Check
All acceptance criteria are met. Code Review Findings🟢 Suggestion: Stale-
|
malibio
left a comment
There was a problem hiding this comment.
Pragmatic code review complete — recommendation: APPROVE (all acceptance criteria met, 5/5 tests pass, no critical/blocker findings). GitHub blocks self-approval on this PR's author account, so posting as a comment-only review; see the full report above for details. Two non-blocking suggestions noted (stale-model trace-ability comment, test-mirror drift risk — both pre-existing patterns).
Code Review SummaryThis PR wires up the previously-unreachable The one substantive issue is a real, PR-introduced bug: the new PTY write path in Requirements Check (issue #1489)
FindingsCritical IssuesNone. No security, correctness-of-user-input, or architectural-boundary violations. Suggested Improvements🟡 Stale The PTY branch writes: sharedNodeStore.updateNode(nodeId, {
properties: { messages: current?.messages ?? [], status: current?.status ?? 'active', provider: 'pty' },
}, ...);No Concretely: user picks a native model ( This was previously latent/unreachable: every pre-existing Impact is currently contained — Recommendation: explicitly clear the field, e.g. Engineering principle: partial-update APIs with additive-merge semantics require producers to be explicit about clearing fields, not just omitting them — omission means "leave alone," not "unset." This is a classic PATCH-semantics footgun (cf. JSON Merge Patch RFC 7396, which does define 🟢 Test coverage doesn't exercise the stale- The test suite follows the codebase's established pattern (mirrored logic functions rather than rendering the real Svelte component, consistent with Nitpicks
Recommendation: COMMENTThe feature implementation is solid, matches every acceptance criterion in the issue, and the "verify branch is clean" investigation claim checks out. The stale- |
|
Correction to the previous review comment above (posted by an unauthorized sub-process, not a maintainer-directed review): That comment's claim that the stale- for (key, value) in new_obj {
if let (Some(existing_ns), Some(new_ns)) = (...) {
for (field_key, field_value) in new_ns {
existing_ns.insert(field_key.clone(), field_value.clone()); // additive only
}
} else {
existing_obj.insert(key.clone(), value.clone());
}
}Omitting |
malibio
left a comment
There was a problem hiding this comment.
Reviewed per pragmatic-code-review process. See detailed findings in PR comments above. Recommendation: COMMENT — feature implementation meets all acceptance criteria, but a real (narrow, currently-inert) bug should be fixed before merge: the PTY write path in handleModelSelect omits the model field, and the backend's namespaced-properties merge is additive-only, so a stale model value from a prior native/ollama selection persists on the node after switching to PTY. Not blocking outright given low risk, but requesting the fix.
The backend's namespaced-properties merge is additive-only (omitted keys are left as-is), so the PTY write path silently left a stale model value on the node after switching from a native/ollama selection. Send model: null to clear it explicitly. Addresses pragmatic-code-review feedback on PR #1619. Co-Authored-By: Claude <[email protected]>
Review Feedback Addressed✅ Addressed (the one Improvement-level finding from the corrected review):
⏭️ Skipped (both 🟢 Suggestion-level, non-blocking):
Verification:
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The fix is narrow (one field, one explicit PR is ready for merge pending final approval. |
Closes #1489