-
Notifications
You must be signed in to change notification settings - Fork 12
iOS: unify host connection status in navigation bar #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
7211bed
446540d
45f7851
54d05d2
5af6c62
91fd90c
a1fe2fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,6 +219,76 @@ function resolvePlannerPlanMissingIntervention(args: { | |
| }; | ||
| } | ||
|
|
||
| function resolvePlannerPlanMissingInterventionsAfterPlanningSuccess(args: { | ||
| ctx: OrchestratorContext; | ||
| deps: UpdateWorkerStateDeps; | ||
| missionId: string; | ||
| attempt: OrchestratorRunGraph["attempts"][number]; | ||
| step: OrchestratorRunGraph["steps"][number]; | ||
| }): void { | ||
| const stepMeta = isRecord(args.step.metadata) ? args.step.metadata : {}; | ||
| const phaseKey = typeof stepMeta.phaseKey === "string" ? stepMeta.phaseKey.trim().toLowerCase() : ""; | ||
| const stepType = typeof stepMeta.stepType === "string" ? stepMeta.stepType.trim().toLowerCase() : ""; | ||
| const readOnlyExecution = stepMeta.readOnlyExecution === true; | ||
| const planningLike = | ||
| readOnlyExecution | ||
| || phaseKey === "planning" | ||
| || stepType === "planning" | ||
| || stepType === "analysis"; | ||
| if (!planningLike) return; | ||
|
|
||
| const lastResultReport = isRecord(stepMeta.lastResultReport) ? stepMeta.lastResultReport : null; | ||
| const reportedPlan = lastResultReport && isRecord(lastResultReport.plan) ? lastResultReport.plan : null; | ||
| const planMarkdown = | ||
| reportedPlan && typeof reportedPlan.markdown === "string" ? reportedPlan.markdown.trim() : ""; | ||
| if (!planMarkdown.length) return; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [🟡 Medium] [🔵 Bug] This helper treats // apps/desktop/src/main/services/orchestrator/workerTracking.ts
const reportedPlan = lastResultReport && isRecord(lastResultReport.plan) ? lastResultReport.plan : null;
const planMarkdown =
reportedPlan && typeof reportedPlan.markdown === "string" ? reportedPlan.markdown.trim() : "";
if (!planMarkdown.length) return;
|
||
|
|
||
| const mission = args.ctx.missionService.get(args.missionId); | ||
| if (!mission) return; | ||
|
|
||
| const resolvedAt = nowIso(); | ||
| for (const intervention of mission.interventions) { | ||
| if (intervention.status !== "open" || intervention.interventionType !== "failed_step") continue; | ||
| const meta = isRecord(intervention.metadata) ? intervention.metadata : {}; | ||
| const reasonCode = typeof meta.reasonCode === "string" ? meta.reasonCode.trim() : ""; | ||
| if (reasonCode !== "planner_plan_missing") continue; | ||
| const interventionRunId = typeof meta.runId === "string" ? meta.runId.trim() : ""; | ||
|
greptile-apps[bot] marked this conversation as resolved.
Outdated
|
||
| if (interventionRunId.length > 0 && interventionRunId !== args.attempt.runId) continue; | ||
|
|
||
| try { | ||
| args.ctx.missionService.resolveIntervention({ | ||
| missionId: args.missionId, | ||
| interventionId: intervention.id, | ||
| status: "resolved", | ||
| note: `Auto-resolved after planner returned report_result.plan for step "${stepTitleForMessage(args.step)}".`, | ||
| }); | ||
| args.deps.recordRuntimeEvent({ | ||
| runId: args.attempt.runId, | ||
| stepId: args.step.id, | ||
| attemptId: args.attempt.id, | ||
| sessionId: args.attempt.executorSessionId, | ||
| eventType: "intervention_resolved", | ||
| eventKey: `intervention_resolved:${intervention.id}:planner_plan_recovered`, | ||
| payload: { | ||
| interventionId: intervention.id, | ||
| reason: "planner_plan_recovered", | ||
| recoveredByStepId: args.step.id, | ||
| recoveredByStepKey: args.step.stepKey, | ||
| resolvedAt, | ||
| }, | ||
| }); | ||
| } catch (error) { | ||
| args.ctx.logger.debug("ai_orchestrator.planner_plan_missing_resolve_failed", { | ||
| missionId: args.missionId, | ||
| runId: args.attempt.runId, | ||
| stepId: args.step.id, | ||
| interventionId: intervention.id, | ||
| error: error instanceof Error ? error.message : String(error), | ||
| }); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| function resolveRecoveredFailedStepInterventions(args: { | ||
| ctx: OrchestratorContext; | ||
| deps: UpdateWorkerStateDeps; | ||
|
|
@@ -1275,6 +1345,13 @@ export function updateWorkerStateFromEventCtx( | |
| attempt, | ||
| step, | ||
| }); | ||
| resolvePlannerPlanMissingInterventionsAfterPlanningSuccess({ | ||
| ctx, | ||
| deps, | ||
| missionId: graph.run.missionId, | ||
| attempt, | ||
| step, | ||
| }); | ||
| } | ||
| if (step && ctx.aiIntegrationService) { | ||
| const runtimeProfile = ctx.runRuntimeProfiles.get(attempt.runId) ?? resolveActiveRuntimeProfile(ctx, graph.run.missionId); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[🟡 Medium] [🔵 Bug]
resolvePlannerPlanMissingInterventionsAfterPlanningSuccess()now treats anyreadOnlyExecutionstep as evidence that the planner contract has recovered:That is broader than ADE's plan persistence path:
requiresPlanApprovalcan make an implementation step read-only (@apps/desktop/src/main/services/orchestrator/orchestratorService.ts), butextractAndRegisterArtifacts()only writes the canonical plan artifact forstepType === "planning" || stepType === "analysis" || phaseKey === "planning"(@apps/desktop/src/main/services/orchestrator/workerTracking.ts). A successful read-only implementation step that returnslastResultReport.plan.markdownwill therefore auto-resolveplanner_plan_missingand may resume the mission even though.ade/plans/mission-plan.mdwas never created. Restrict this resolver to the same planning-step predicate used by artifact registration, or verify that the plan artifact was actually registered before resolving.