fix(mma-exec): strip ANTHROPIC_API_KEY from subprocess env to use subscription login
When ANTHROPIC_API_KEY is set in the shell environment, claude --print routes through the API key instead of subscription auth. Stripping it forces the CLI to use subscription login for all Tier 3/4 delegation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -197,6 +197,7 @@ def execute_agent(role: str, prompt: str, docs: list[str]) -> str:
|
|||||||
try:
|
try:
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['CLAUDE_CLI_HOOK_CONTEXT'] = 'mma_headless'
|
env['CLAUDE_CLI_HOOK_CONTEXT'] = 'mma_headless'
|
||||||
|
env.pop('ANTHROPIC_API_KEY', None) # Force CLI to use subscription login, not API key
|
||||||
process = subprocess.run(
|
process = subprocess.run(
|
||||||
cmd,
|
cmd,
|
||||||
input=command_text,
|
input=command_text,
|
||||||
|
|||||||
Reference in New Issue
Block a user