feat(command-code): add opt-in projectContext envelope for /alpha/generate - #4228
feat(command-code): add opt-in projectContext envelope for /alpha/generate#4228yansigit wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
⏳ DRAFT
What to do
Review readiness checklist
✅ 4/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
리뷰 · 우선순위 44 / 80이 PR은 Command Code( 점수가 중간인 이유는 일곱 레인 계획에서 L1/L5만 첫 구현이 들어갔고, Command Code 로컬 컨텍스트는 그 레인의 급한 막힘이 아니기 때문입니다. 설계 자체는 조심스럽습니다. 읽기는 용량 상한·타임아웃·canonical path로 cwd 밖 차단·실패 시 빈 값 처리가 있고, 결과는 cwd 키 캐시(최대 128, TTL 30초)입니다. 지금 막힌 이유는 기능보다 게이트입니다. 아직 draft이고, 설명과 코드가 어긋납니다. PR 본문은 스킬 경로를 보안은 opt-in이라 기본 위험은 낮습니다. 그래도 켜는 순간 워크스페이스 문서를 업스트림으로 보내므로, 팀 공유 설정에 라인 37-41 - 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Ingwannu
left a comment
There was a problem hiding this comment.
Reviewed 88c87a1. The opt-in/default-empty behavior is useful, but the finite enumeration claim is not enforced by listSkillDirs: the stopping condition is names.length >= scanBudget, reached only after a non-hidden directory with a valid SKILL.md is accepted. Hidden entries, regular files, and directories without SKILL.md never consume that budget. The new test contains 300 valid skill directories, so it cannot catch this case.
Count every visited directory entry against an independent scan budget before filtering, while retaining the separate selected-skill limit. Add a mixed/nonmatching-entry test which observes the iterator count, plus the existing valid-directory positive control. Keep timeout cleanup; a timeout is not a substitute for the documented work cap.
Also align docs/body with the actual paths: .commandcode/taste/taste.md, .commandcode/skills, .agents/skills, .pi/skills. Explain that currentWorkingDirectory() is the OCX process working directory, not automatically the caller's remote workspace. The feature sends those local contents upstream when enabled, so a sponsorship decision still requires that configuration boundary to be accepted. I have not applied a sponsorship label, enabled CI, or executed project file reads.
Summary
Add opt-in
projectContext: "on"provider configuration for Command Code (command-code).When enabled on a
command-codeprovider, opencodex loads bounded local repository context (AGENTS.md,taste.md, and workspace skills fromskills/,.codex/skills/, and.agents/skills/) into the/alpha/generatepayload instead of emptymemory,taste, andskillsfields.EMPTY_COMMAND_CODE_PROJECT_CONTEXT), preserving the existing behavior.Surface context:
src/server/auth-cors.tsregistersprojectContext: "editor"inPROVIDER_CONFIG_FIELD_POLICYto satisfy TypeScriptRecord<keyof OcxProviderConfig, ProviderConfigFieldPolicy>. Maintainer sponsorship is requested perMAINTAINERS.mdsecurity review policy.Verification
All verification commands executed via the isolated testing wrapper with clean temporary
OPENCODEX_HOMEand isolated ports:bun test tests/providers/command-code-project-context.test.ts tests/providers/command-code-provider.test.ts: 73 passed, 0 failed (233 expect calls).bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts: 17 passed, 0 failed (551 expect calls).bun test tests/providers/provider-config-validation.test.ts tests/server/config.test.ts: 206 passed, 0 failed.bun run typecheck: zero diagnostics.bun run privacy:scan: passed cleanly./Users/user/.opencodexremained completely untouched.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.