fix: commands respect selected environment
Backend: AgentRegistryService gains findByApplicationAndEnvironment() and environment-aware addGroupCommandWithReplies() overload. AgentCommandController and ApplicationConfigController accept optional environment query parameter. When set, commands only target agents in that environment. Backward compatible — null means all environments. Frontend: All command mutations (config update, route control, traced processors, tap config, route recording) now pass selectedEnv to the backend via query parameter. Prevents cross-environment command leakage — e.g., updating config for prod no longer pushes to dev agents. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -344,7 +344,7 @@ export default function RouteDetail() {
|
||||
function toggleRecording() {
|
||||
if (!config.data) return;
|
||||
const routeRecording = { ...config.data.routeRecording, [routeId!]: !isRecording };
|
||||
updateConfig.mutate({ ...config.data, routeRecording });
|
||||
updateConfig.mutate({ config: { ...config.data, routeRecording }, environment: selectedEnv });
|
||||
}
|
||||
|
||||
// ── Derived data ───────────────────────────────────────────────────────────
|
||||
@@ -545,14 +545,14 @@ export default function RouteDetail() {
|
||||
const taps = editingTap
|
||||
? config.data.taps.map(t => t.tapId === editingTap.tapId ? tap : t)
|
||||
: [...(config.data.taps || []), tap];
|
||||
updateConfig.mutate({ ...config.data, taps });
|
||||
updateConfig.mutate({ config: { ...config.data, taps }, environment: selectedEnv });
|
||||
setTapModalOpen(false);
|
||||
}
|
||||
|
||||
function deleteTap(tap: TapDefinition) {
|
||||
if (!config.data) return;
|
||||
const taps = config.data.taps.filter(t => t.tapId !== tap.tapId);
|
||||
updateConfig.mutate({ ...config.data, taps });
|
||||
updateConfig.mutate({ config: { ...config.data, taps }, environment: selectedEnv });
|
||||
setDeletingTap(null);
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ export default function RouteDetail() {
|
||||
const taps = config.data.taps.map(t =>
|
||||
t.tapId === tap.tapId ? { ...t, enabled: !t.enabled } : t,
|
||||
);
|
||||
updateConfig.mutate({ ...config.data, taps });
|
||||
updateConfig.mutate({ config: { ...config.data, taps }, environment: selectedEnv });
|
||||
}
|
||||
|
||||
function runTestExpression() {
|
||||
|
||||
Reference in New Issue
Block a user