Allow remote detect in production until local Ollama is connected.
Keep KANSHO_ENV=production and require an explicit operator flag instead of treating Prod as Development. Promote to Prod only via merge commit on main. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
dd7858347c
commit
af6fe55577
23 files changed
+236
-27
No files matched your search
@@ -570,7 +570,13 @@ def main() -> None:
|
||||
)
|
||||
expect(uses_llm_detect(remote), "development allows remote detect")
|
||||
os.environ["KANSHO_ENV"] = "production"
|
||||
os.environ.pop("KANSHO_ALLOW_REMOTE_DETECT", None)
|
||||
expect(not uses_llm_detect(remote), "production blocks remote detect")
|
||||
os.environ["KANSHO_ALLOW_REMOTE_DETECT"] = "1"
|
||||
expect(uses_llm_detect(remote), "operator override allows remote detect in production")
|
||||
os.environ["KANSHO_ALLOW_REMOTE_DETECT"] = "0"
|
||||
expect(not uses_llm_detect(remote), "false override does not allow remote detect")
|
||||
os.environ.pop("KANSHO_ALLOW_REMOTE_DETECT", None)
|
||||
local = ProviderConfig(
|
||||
role="detect",
|
||||
name="ollama",
|
||||
@@ -584,6 +590,7 @@ def main() -> None:
|
||||
)
|
||||
expect(uses_llm_detect(local), "production still allows local detect")
|
||||
os.environ.pop("KANSHO_ENV", None)
|
||||
os.environ.pop("KANSHO_ALLOW_REMOTE_DETECT", None)
|
||||
|
||||
mapped = [{"local_label": "Anna", "token": "PERSON:01"}]
|
||||
anna_manifest = mask_prompt("Anna war am Markt.", mapped, "journal_generate")
|
||||
|
||||
Reference in new issue
Block a user