mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-29 16:03:34 +08:00
fix: launch scheduled tasks with the sdk cli entrypoint
Scheduled task subprocesses should normalize their child environment instead of inheriting a stale parent entrypoint. Setting the default task entrypoint keeps launcher tests and non-OAuth task execution on the SDK CLI path while still allowing the official OAuth environment overlay to provide its desktop-specific entrypoint. Constraint: Official OAuth tasks intentionally overlay provider-specific environment after the default child task environment is built Rejected: Preserve parent CLAUDE_CODE_ENTRYPOINT | stale parent values can leak into scheduled task launches Confidence: high Scope-risk: narrow Directive: Keep default task launcher environment deterministic before provider-specific overlays are applied Tested: bun test src/server/__tests__/cron-scheduler-launcher.test.ts Tested: bun run check:server Not-tested: Full verify still blocked by existing agent-utils global coverage baseline
This commit is contained in:
parent
571d771025
commit
e2b1ac9fd1
@ -244,6 +244,7 @@ describe('cron scheduler launcher resolution', () => {
|
|||||||
process.env.CLAUDE_APP_ROOT = appRoot
|
process.env.CLAUDE_APP_ROOT = appRoot
|
||||||
process.env.ANTHROPIC_BASE_URL = 'https://stale-parent.example'
|
process.env.ANTHROPIC_BASE_URL = 'https://stale-parent.example'
|
||||||
process.env.ANTHROPIC_MODEL = 'stale-parent-model'
|
process.env.ANTHROPIC_MODEL = 'stale-parent-model'
|
||||||
|
process.env.CLAUDE_CODE_ENTRYPOINT = 'stale-parent-entrypoint'
|
||||||
|
|
||||||
const provider = await new ProviderService().addProvider({
|
const provider = await new ProviderService().addProvider({
|
||||||
presetId: 'custom',
|
presetId: 'custom',
|
||||||
|
|||||||
@ -662,6 +662,7 @@ export class CronScheduler {
|
|||||||
return {
|
return {
|
||||||
...cleanEnv,
|
...cleanEnv,
|
||||||
CLAUDE_CODE_ENABLE_TASKS: '1',
|
CLAUDE_CODE_ENABLE_TASKS: '1',
|
||||||
|
CLAUDE_CODE_ENTRYPOINT: 'sdk-cli',
|
||||||
CALLER_DIR: workDir,
|
CALLER_DIR: workDir,
|
||||||
PWD: workDir,
|
PWD: workDir,
|
||||||
CC_HAHA_SKIP_DOTENV: '1',
|
CC_HAHA_SKIP_DOTENV: '1',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user