Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,30 @@
</form>
</mat-card>

<mat-card *ngIf="agentDetails()?.state === 'hitl_user'" class="p-3 mb-4">
<form [formGroup]="userHilForm" (ngSubmit)="onResumeUserHil()">
<mat-card-title class="font-bold pl-5 text-lg">Human-in-the-Loop Check Requested</mat-card-title>
<mat-card-content>
<p class="mb-4">You have requested a Human-in-the-Loop check. Review the agent's progress and optionally provide additional guidance.</p>
<mat-form-field appearance="fill" class="full-width">
<textarea
matInput
class="resumeField"
placeholder="Add optional note for the agent (optional)"
formControlName="note"
></textarea>
</mat-form-field>
</mat-card-content>
<mat-card-actions>
<button mat-raised-button color="primary" type="submit" [disabled]="isSubmitting()">
{{ isSubmitting() ? 'Resuming...' : 'Resume' }}
</button>
<button mat-raised-button color="warn" class="ml-4" (click)="cancelAgent()" [disabled]="isSubmitting()">Cancel Agent
</button>
</mat-card-actions>
</form>
</mat-card>

<mat-card class="p-8">
<div>
<mat-icon (click)="handleRefreshAgentDetails()" class="mr-3 cursor-pointer" [matTooltip]="'Reload'">refresh</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class AgentDetailsComponent implements OnInit {
feedbackForm: FormGroup;
hilForm: FormGroup;
errorForm: FormGroup;
userHilForm: FormGroup; // NEW: Form for hitl_user state

isSubmitting = signal(false);
isResumingError = signal(false);
Expand Down Expand Up @@ -109,6 +110,7 @@ export class AgentDetailsComponent implements OnInit {
this.feedbackForm = this.formBuilder.group({ feedback: ['', Validators.required] });
this.hilForm = this.formBuilder.group({ feedback: [''] });
this.errorForm = this.formBuilder.group({ errorDetails: ['', Validators.required] });
this.userHilForm = this.formBuilder.group({ note: [''] });

// Handle error side effects with RxJS
toObservable(this.functionsError)
Expand Down Expand Up @@ -192,6 +194,33 @@ export class AgentDetailsComponent implements OnInit {
});
}

onResumeUserHil(): void {
if (!this.userHilForm.valid) return;
this.isSubmitting.set(true);
const note = this.userHilForm.get('note')?.value;
const currentAgentDetails = this.agentDetails();
this.agentService
.resumeAgent(currentAgentDetails.agentId, currentAgentDetails.executionId, note)
.pipe(
takeUntilDestroyed(this.destroyRef),
catchError((error) => {
console.error('Error resuming agent from user HIL:', error);
this.snackBar.open('Error resuming agent', 'Close', { duration: 3000 });
return of(null);
}),
finalize(() => {
this.isSubmitting.set(false);
}),
)
.subscribe((response) => {
if (response) {
this.snackBar.open('Agent resumed successfully', 'Close', { duration: 3000 });
this.userHilForm.reset();
this.handleRefreshAgentDetails();
}
});
}

onResumeError(): void {
if (!this.errorForm.valid) return;
this.isResumingError.set(true);
Expand Down
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"repos": " node -r esbuild-register src/cli/repos.ts",
"scrape": " node -r esbuild-register src/cli/scrape.ts",
"slack": " node -r esbuild-register src/cli/slack.ts",
"slackHistory": "node -r esbuild-register --env-file=variables/local.env src/modules/slack/slackChatHistory.ts",
"summarize": "node -r esbuild-register src/cli/summarize.ts",
"swe": " node -r esbuild-register src/cli/swe.ts",
"swebench": " node -r esbuild-register src/cli/swebench.ts",
Expand Down Expand Up @@ -93,13 +94,13 @@
"@ghostery/adblocker-puppeteer": "2.11.3",
"@gitbeaker/core": "43.5.0",
"@gitbeaker/rest": "43.5.0",
"@google-cloud/aiplatform": "^5.7.0",
"@google-cloud/aiplatform": "5.12.0",
"@google-cloud/bigquery": "^8.1.1",
"@google-cloud/discoveryengine": "^2.4.0",
"@google-cloud/firestore": "^7.11.3",
"@google-cloud/discoveryengine": "2.5.2",
"@google-cloud/firestore": "7.11.6",
"@google-cloud/opentelemetry-cloud-trace-exporter": "^2.4.1",
"@google-cloud/secret-manager": "^6.1.0",
"@google-cloud/storage": "^7.17.1",
"@google-cloud/secret-manager": "6.1.1",
"@google-cloud/storage": "7.17.2",
"@google-cloud/vertexai": "^1.10.0",
"@grpc/grpc-js": "^1.13.4",
"@microsoft/tiktokenizer": "^1.0.10",
Expand Down Expand Up @@ -129,6 +130,7 @@
"chromadb": "^1.9.2",
"clipboardy": "^4.0.0",
"cloud-pine": "^2.0.1",
"commander": "^14.0.2",
"crawlee": "^3.8.1",
"cross-fetch": "^3.1.8",
"date-fns": "^4.1.0",
Expand Down Expand Up @@ -173,7 +175,7 @@
"string-similarity-js": "^2.1.4",
"strip-ansi": "^7.1.0",
"table": "^6.9.0",
"tree-sitter": "^0.21.0",
"tree-sitter": "^0.25.0",
"tree-sitter-typescript": "^0.23.2",
"ts-morph": "^21.0.1",
"ts-node": "^10.7.0",
Expand Down Expand Up @@ -220,6 +222,14 @@
"secretlint": "^8.2.4",
"sinon": "^17.0.0",
"sinon-chai": "^3.7.0",
"tree-sitter-c-sharp": "^0.23.1",
"tree-sitter-cpp": "^0.23.4",
"tree-sitter-go": "^0.25.0",
"tree-sitter-java": "^0.23.5",
"tree-sitter-javascript": "^0.25.0",
"tree-sitter-python": "^0.25.0",
"tree-sitter-rust": "^0.24.0",
"tree-sitter-scala": "^0.24.0",
"ts-node-dev": "^2.0.0",
"tsc-watch": "^4.0.0",
"typescript": "5.9.2"
Expand Down
Loading
Loading