fix: colony creation link

This commit is contained in:
Timothy
2026-04-13 19:46:24 -07:00
parent 846f3f2470
commit e3d1cb6739
2 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -34,7 +34,9 @@
"Bash(awk -F'::' '{print $1}')", "Bash(awk -F'::' '{print $1}')",
"Bash(wait)", "Bash(wait)",
"Bash(pkill -f \"pytest.*test_event_loop_node\")", "Bash(pkill -f \"pytest.*test_event_loop_node\")",
"Bash(pkill -f \"pytest.*TestToolConcurrency\")" "Bash(pkill -f \"pytest.*TestToolConcurrency\")",
"Bash(grep -n \"def.*discover\\\\|/api/agents\\\\|agents_discover\" /home/timothy/aden/hive/core/framework/server/*.py)",
"Bash(bun run:*)"
], ],
"additionalDirectories": [ "additionalDirectories": [
"/home/timothy/.hive/skills/writing-hive-skills", "/home/timothy/.hive/skills/writing-hive-skills",
+6 -2
View File
@@ -14,7 +14,7 @@ import type { AgentEvent, HistorySession } from "@/api/types";
import { sseEventToChatMessage } from "@/lib/chat-helpers"; import { sseEventToChatMessage } from "@/lib/chat-helpers";
import { useColony } from "@/context/ColonyContext"; import { useColony } from "@/context/ColonyContext";
import { useHeaderActions } from "@/context/HeaderActionsContext"; import { useHeaderActions } from "@/context/HeaderActionsContext";
import { getQueenForAgent } from "@/lib/colony-registry"; import { getQueenForAgent, slugToColonyId } from "@/lib/colony-registry";
const makeId = () => Math.random().toString(36).slice(2, 9); const makeId = () => Math.random().toString(36).slice(2, 9);
@@ -491,6 +491,10 @@ export default function QueenDM() {
const isNew = (event.data?.is_new as boolean) ?? true; const isNew = (event.data?.is_new as boolean) ?? true;
const skillName = (event.data?.skill_name as string) || ""; const skillName = (event.data?.skill_name as string) || "";
if (!colonyName) break; if (!colonyName) break;
// ColonyContext keys colonies by slugToColonyId(slug), not by the
// raw snake_case directory name. Apply the same transform so the
// /colony/:colonyId route lookup in colony-chat.tsx resolves.
const routeId = slugToColonyId(colonyName);
const msg: ChatMessage = { const msg: ChatMessage = {
id: makeId(), id: makeId(),
agent: "System", agent: "System",
@@ -500,7 +504,7 @@ export default function QueenDM() {
colony_name: colonyName, colony_name: colonyName,
is_new: isNew, is_new: isNew,
skill_name: skillName, skill_name: skillName,
href: `/colony/${colonyName}`, href: `/colony/${routeId}`,
}), }),
timestamp: "", timestamp: "",
type: "colony_link", type: "colony_link",