Conversations are the chat module's own tables. A turn is stored before it is acknowledged, runs after the turns before it in its session, and records everything it streams, so a reader replays it from a cursor. The agent uses the configured agent model, the same connector tools as a run and the dashboard's own reads; every action is judged, and one judgement holds is put to people through approvals and run once when approved. A restart fails the turns it interrupted visibly and never restarts a started action. Conversation memory is a set of notes in the memory module. The chat prompts are copied from internal/prompts (chat-system.tmpl, soul.md, session-title.md) into internal/platform/prompts while the gateway still reads them; the tool parameter redaction is copied from internal/domain/messaging/tool_parameters.go. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
27 lines
840 B
Go
27 lines
840 B
Go
package chat
|
|
|
|
import "testing"
|
|
|
|
// TestDashboardPathStaysInTheDashboard guards the link the agent can offer
|
|
// the operator: it must never lead off the dashboard or outside its pages.
|
|
func TestDashboardPathStaysInTheDashboard(t *testing.T) {
|
|
cases := map[string]bool{
|
|
"/runs": true,
|
|
"/runs/0b8f6c1e-4a7e-4f6d": true,
|
|
"/classes/github:merge_pr": true,
|
|
"//evil.example/runs": false,
|
|
"https://evil.example/runs": false,
|
|
"javascript:alert(1)": false,
|
|
"/runs/../settings": false,
|
|
"/runs/a/b": false,
|
|
"/runs/..": false,
|
|
"/admin": false,
|
|
"runs": false,
|
|
}
|
|
for path, want := range cases {
|
|
if got := dashboardPath(path); got != want {
|
|
t.Errorf("dashboardPath(%q) = %v, want %v", path, got, want)
|
|
}
|
|
}
|
|
}
|