{"record":{"id":"582f21542de2b704","repo":"sgl-project/sglang","slug":"unknown-interaction-strategy-strategy","errorCode":null,"errorMessage":"Unknown interaction strategy: {strategy}","messagePattern":"Unknown interaction strategy: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/bridges/mova_dual_tower.py","lineNumber":173,"sourceCode":"            num_interact = min(10, self.min_layers // 3)\n            interact_layers = list(range(0, num_interact))\n        elif strategy == \"distributed\":\n            step = 3\n            interact_layers = list(range(0, self.min_layers, step))\n        elif strategy == \"progressive\":\n            shallow = list(range(0, min(8, self.min_layers)))\n            if self.min_layers > 8:\n                deep = list(range(8, self.min_layers, 3))\n                interact_layers = shallow + deep\n            else:\n                interact_layers = shallow\n        elif strategy == \"custom\":\n            interact_layers = [0, 2, 4, 6, 8, 12, 16, 20]\n            interact_layers = [i for i in interact_layers if i < self.min_layers]\n        elif strategy == \"full\":\n            interact_layers = list(range(0, self.min_layers))\n        else:\n            raise ValueError(f\"Unknown interaction strategy: {strategy}\")\n\n        mapping = {\n            \"v2a\": [(i, i) for i in interact_layers],\n            \"a2v\": [(i, i) for i in interact_layers],\n        }\n        return mapping\n\n    def should_interact(\n        self, layer_idx: int, direction: str, interaction_mapping: Dict\n    ) -> bool:\n        \"\"\"Determines if the specified layer needs to interact.\"\"\"\n        if direction not in interaction_mapping:\n            return False\n        return any(src == layer_idx for src, _ in interaction_mapping[direction])\n\n\nclass ConditionalCrossAttention(nn.Module):\n    \"\"\"","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/bridges/mova_dual_tower.py#L155-L191","documentation":"MovaDualTower.get_interaction_layers maps a strategy string (e.g. 'custom', 'full') to the set of layer indices where the audio and vision towers interact. Any strategy string outside the supported set hits the final else and raises.","triggerScenarios":"Calling `get_interaction_layers(strategy=...)` (invoked from __init__) with a misspelled or unsupported value such as 'adaptive', 'cross', 'Custom', or an empty string.","commonSituations":"Copy-pasting a config key from another dual-tower implementation; typos or case mismatch in a YAML/JSON config; adding a new strategy constant that was never wired into this if/elif chain.","solutions":["Check the if/elif chain in get_interaction_layers for the accepted strategy values and use one of them (e.g. 'custom' or 'full')","Fix typos / casing in the config value feeding the strategy argument","If you need a new strategy, extend the chain in the source and map it to an explicit layer list","Add config validation (Literal/Enum) at the config-parsing layer so invalid values fail with a clearer message"],"exampleFix":"# before\ntower = MovaDualTower(..., interaction_strategy=\"adaptive\")\n# after\nfrom typing import Literal\nstrategy: Literal[\"custom\", \"full\"] = \"custom\"\ntower = MovaDualTower(..., interaction_strategy=strategy)","handlingStrategy":"validation","validationCode":"assert strategy in (\"custom\", \"full\"), f\"unsupported interaction strategy: {strategy}\"","typeGuard":"from typing import Literal\nInteractionStrategy = Literal[\"custom\", \"full\"]\ndef is_valid_strategy(s: str) -> bool:\n    return s in (\"custom\", \"full\")","tryCatchPattern":"try:\n    tower = MovaDualTower(...)\nexcept ValueError as e:\n    if \"Unknown interaction strategy\" in str(e):\n        raise ValueError(\"check config 'interaction_strategy'; supported: custom, full\") from e\n    raise","preventionTips":["Centralize strategy constants in one module and import them everywhere","Parse configs with Literal/Enum types so invalid values fail at load, not at model init"],"tags":["config-validation","enum-value","dual-tower","mova"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}