Files
multica/server/internal/daemon/execenv/runtime_config_kind.go
Multica Eve 0c2e48ded2 refactor: retire FF_RUNTIME_BRIEF_SLIM, make slim runtime brief the only path (MUL-4297)
The runtime_brief_slim feature flag has burned in; the slim runtime brief is now the sole path.

- execenv: buildMetaSkillContent / BuildCommentReplyInstructions delegate to the slim assembler unconditionally; delete the legacy verbose brief body and writeBackgroundTaskSafetyInstructions.
- Remove the runtime_brief_slim flag and the daemon-bound flag delivery subsystem built solely for it: execenv flag wiring (runtime_config_flag.go, server_snapshot_provider.go), the featureflagdispatch package, the DaemonFeatureFlagSnapshot heartbeat protocol field, and the server/daemon wiring in router.go, handler, daemon.go, main.go, cmd_daemon.go.
- Keep the generic server/pkg/featureflag engine (still used by composio_mcp_apps).
- Update tests to slim-only expectations and docs/feature-flags.md.

Co-authored-by: Eve <eve@multica-ai.local>
Co-authored-by: multica-agent <github@multica.ai>
2026-07-09 13:48:33 +08:00

72 lines
2.5 KiB
Go

package execenv
// taskKind labels the dispatch path that the runtime brief should
// follow for a given TaskContextForEnv. Used by
// `buildMetaSkillContentSlim` (MUL-3560 brief; the `runtime_brief_slim`
// flag that once gated it against a legacy verbose brief was retired in
// MUL-4297, so this is now the only brief).
//
// Five kinds, mutually exclusive in practice. classifyTask documents the
// tiebreak rule that applies if a future caller accidentally violates the
// mutex.
type taskKind int
const (
// kindCommentTriggered: a NEW comment on an issue triggered this run.
kindCommentTriggered taskKind = iota
// kindAssignmentTriggered: an assignee was set / changed on an issue
// and the daemon fired a fresh run for the new assignee.
kindAssignmentTriggered
// kindAutopilotRunOnly: an autopilot fired in run-only mode (no
// issue created or attached).
kindAutopilotRunOnly
// kindQuickCreate: one-shot "create an issue from a natural-language
// prompt" task.
kindQuickCreate
// kindChat: interactive chat session, no issue.
kindChat
)
// classifyTask maps a TaskContextForEnv to the single taskKind the slim
// brief should be assembled for. Precedence (documented for the tiebreak
// case, although the daemon never sets two specific-kind flags at once):
// chat → quick-create → autopilot run-only → comment-triggered →
// assignment-triggered.
func classifyTask(ctx TaskContextForEnv) taskKind {
switch {
case ctx.ChatSessionID != "":
return kindChat
case ctx.QuickCreatePrompt != "":
return kindQuickCreate
case ctx.AutopilotRunID != "":
return kindAutopilotRunOnly
case ctx.TriggerCommentID != "":
return kindCommentTriggered
default:
return kindAssignmentTriggered
}
}
// hasIssueContext returns true for the kinds that operate on a real Multica
// issue and therefore can read / pin issue-scoped state. The slim
// dispatcher gates these three sections on this predicate:
//
// - Project Context
// - Issue Metadata
// - Sub-issue Creation
//
// All three are meaningless on the issue-less kinds (chat / quick-create /
// autopilot run-only) and would either render an empty body or steer the
// agent into a guaranteed-failed CLI call. Note this is a kind-based
// predicate, not a check on ctx.IssueID — comment- / assignment-triggered
// kinds always carry an issue id by construction (the daemon refuses to
// dispatch them otherwise), and the other three kinds never do.
func (k taskKind) hasIssueContext() bool {
switch k {
case kindCommentTriggered, kindAssignmentTriggered:
return true
default:
return false
}
}