mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
fix(server): re-author --skip-permissions CLI flag wiring
Independent re-implementation of the --skip-permissions argparse flag, OR-ed with the tools.skip_permissions config-store setting at both consumption sites. Written from the flag's pre-existing spec (the --help epilog and compose.yaml, which referenced it before #450 existed). Replaces reverted #450 so that 1.6.0 ships no non-consented contributions under Apache 2.0. Provenance record in #548.
This commit is contained in:
+7
-2
@@ -4088,6 +4088,11 @@ def main() -> None:
|
|||||||
default=8080,
|
default=8080,
|
||||||
help="Port to listen on (default: 8080)",
|
help="Port to listen on (default: 8080)",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--skip-permissions",
|
||||||
|
action="store_true",
|
||||||
|
help="Auto-approve all tool calls without prompting (same as tools.skip_permissions)",
|
||||||
|
)
|
||||||
# MCP config path is bootstrap-critical (needed before ConfigStore for tool loading)
|
# MCP config path is bootstrap-critical (needed before ConfigStore for tool loading)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--mcp-config",
|
"--mcp-config",
|
||||||
@@ -4533,7 +4538,7 @@ def main() -> None:
|
|||||||
ws = manager.create(user_id="", name="resumed")
|
ws = manager.create(user_id="", name="resumed")
|
||||||
if not isinstance(ws.ui, WebUI):
|
if not isinstance(ws.ui, WebUI):
|
||||||
raise TypeError(f"Expected WebUI, got {type(ws.ui).__name__}")
|
raise TypeError(f"Expected WebUI, got {type(ws.ui).__name__}")
|
||||||
if config_store.get("tools.skip_permissions"):
|
if args.skip_permissions or config_store.get("tools.skip_permissions"):
|
||||||
ws.ui.auto_approve = True
|
ws.ui.auto_approve = True
|
||||||
assert ws.session is not None
|
assert ws.session is not None
|
||||||
ws.session.set_watch_runner(_watch_runner)
|
ws.session.set_watch_runner(_watch_runner)
|
||||||
@@ -4569,7 +4574,7 @@ def main() -> None:
|
|||||||
_advertise_host = args.host if args.host not in ("0.0.0.0", "::") else socket.gethostname()
|
_advertise_host = args.host if args.host not in ("0.0.0.0", "::") else socket.gethostname()
|
||||||
_advertise_url = f"http://{_advertise_host}:{args.port}"
|
_advertise_url = f"http://{_advertise_host}:{args.port}"
|
||||||
|
|
||||||
_skip_perms = config_store.get("tools.skip_permissions")
|
_skip_perms = args.skip_permissions or config_store.get("tools.skip_permissions")
|
||||||
app = create_app(
|
app = create_app(
|
||||||
workstreams=manager,
|
workstreams=manager,
|
||||||
global_queue=global_queue,
|
global_queue=global_queue,
|
||||||
|
|||||||
Reference in New Issue
Block a user