Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d1e9647d9 | ||
|
|
77189b6114 | ||
|
|
c32d315910 | ||
|
|
606ffd8275 | ||
|
|
601dba3fc4 |
@@ -275,7 +275,7 @@ var _ = Describe("Agent test", func() {
|
||||
EnableStandaloneJob,
|
||||
EnableHUD,
|
||||
WithPeriodicRuns("1s"),
|
||||
WithPermanentGoal("use the new_conversation tool"),
|
||||
WithPermanentGoal("use the new_conversation tool to initiate a conversation with the user"),
|
||||
// EnableStandaloneJob,
|
||||
// WithRandomIdentity(),
|
||||
)
|
||||
|
||||
@@ -128,11 +128,13 @@ func (g *GithubPRReviewer) Run(ctx context.Context, params types.ActionParams) (
|
||||
}
|
||||
|
||||
actionResult := fmt.Sprintf(
|
||||
"Pull request https://github.com/%s/%s/pull/%d reviewed successfully with status: %s",
|
||||
"Pull request https://github.com/%s/%s/pull/%d reviewed successfully with status: %s, comments: %v, message: %s",
|
||||
result.Owner,
|
||||
result.Repository,
|
||||
result.PRNumber,
|
||||
strings.ToLower(result.ReviewAction),
|
||||
result.Comments,
|
||||
result.ReviewComment,
|
||||
)
|
||||
|
||||
return types.ActionResult{Result: actionResult}, nil
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useParams, Link, useNavigate } from 'react-router-dom';
|
||||
import { useParams, Link } from 'react-router-dom';
|
||||
|
||||
function AgentStatus() {
|
||||
const { name } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [statusData, setStatusData] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const [eventSource, setEventSource] = useState(null);
|
||||
const [_eventSource, setEventSource] = useState(null);
|
||||
const [liveUpdates, setLiveUpdates] = useState([]);
|
||||
|
||||
// Update document title
|
||||
@@ -49,7 +48,7 @@ function AgentStatus() {
|
||||
const data = JSON.parse(event.data);
|
||||
setLiveUpdates(prev => [data, ...prev.slice(0, 19)]); // Keep last 20 updates
|
||||
} catch (err) {
|
||||
console.error('Error parsing SSE data:', err);
|
||||
setLiveUpdates(prev => [event.data, ...prev.slice(0, 19)]);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -129,23 +128,9 @@ function AgentStatus() {
|
||||
<h2 className="text-sm font-semibold mb-2">Agent Action:</h2>
|
||||
<div className="status-details">
|
||||
<div className="status-row">
|
||||
<span className="status-label">Result:</span>
|
||||
<span className="status-value">{formatValue(item.Result)}</span>
|
||||
<span className="status-label">{index}</span>
|
||||
<span className="status-value">{formatValue(item)}</span>
|
||||
</div>
|
||||
<div className="status-row">
|
||||
<span className="status-label">Action:</span>
|
||||
<span className="status-value">{formatValue(item.Action)}</span>
|
||||
</div>
|
||||
<div className="status-row">
|
||||
<span className="status-label">Parameters:</span>
|
||||
<span className="status-value pre-wrap">{formatValue(item.Params)}</span>
|
||||
</div>
|
||||
{item.Reasoning && (
|
||||
<div className="status-row">
|
||||
<span className="status-label">Reasoning:</span>
|
||||
<span className="status-value reasoning">{formatValue(item.Reasoning)}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@ export default defineConfig(({ mode }) => {
|
||||
'/status': backendUrl,
|
||||
'/action': backendUrl,
|
||||
'/actions': backendUrl,
|
||||
'/avatars': backendUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/subtle"
|
||||
"embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
@@ -238,9 +239,20 @@ func (app *App) registerRoutes(pool *state.AgentPool, webapp *fiber.App) {
|
||||
history = &state.Status{ActionResults: []types.ActionState{}}
|
||||
}
|
||||
|
||||
entries := []string{}
|
||||
for _, h := range Reverse(history.Results()) {
|
||||
entries = append(entries, fmt.Sprintf(
|
||||
"Result: %v Action: %v Params: %v Reasoning: %v",
|
||||
h.Result,
|
||||
h.Action.Definition().Name,
|
||||
h.Params,
|
||||
h.Reasoning,
|
||||
))
|
||||
}
|
||||
|
||||
return c.JSON(fiber.Map{
|
||||
"Name": c.Params("name"),
|
||||
"History": Reverse(history.Results()),
|
||||
"History": entries,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user