Skip to content

Address review feedback on actor handling and push semantics#14

Draft
Copilot wants to merge 3 commits into
feat/actor-aware-git-identitiesfrom
copilot/sub-pr-6
Draft

Address review feedback on actor handling and push semantics#14
Copilot wants to merge 3 commits into
feat/actor-aware-git-identitiesfrom
copilot/sub-pr-6

Conversation

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown

Summary

This update addresses review feedback on the actor-aware git identity work by tightening actor typing/validation and simplifying the user push path. The goal is to make actor behavior explicit, fail-closed on invalid inputs, and reduce ambiguous push APIs.

  • Actor model cleanup

    • Replaced duplicated Literal + constants pattern with a single GitActor enum (USER, AGENT) in git_service.
    • Kept callsites aligned to explicit actor values where actor routing matters.
  • Explicit/fail-closed actor checks

    • git_service._actor_env() now explicitly branches on USER/AGENT and raises on unsupported actor values.
    • github_service._token_for_actor() now explicitly handles USER vs AGENT; unsupported actors raise GitHubError.
  • Push API narrowing

    • Simplified git_service.push() to user/base-branch semantics only (no remote/branch args).
    • Agent branch pushes continue through push_branch(); human writes/autosave continue through push().
  • Operational safety

    • Added once-per-process, thread-safe warning when AGENT GitHub token is missing and fallback token is used (avoids log spam).
  • Test updates

    • Updated affected tests/call expectations for the narrowed push() contract.
    • Added/kept focused coverage for actor validation paths.
class GitActor(str, Enum):
    USER = "user"
    AGENT = "agent"

def push(retries: int = 2) -> None:
    # user-only base-branch push helper
    _run("push", settings.git_remote, settings.git_branch, actor=USER_ACTOR)

Context System Checklist

  • I updated docs when behavior/semantics changed.
  • If API behavior changed, I updated related product/spec docs.
  • If reliability/security assumptions changed, I updated runbooks/topical docs.
  • I verified generated artifacts are up to date (python3 scripts/generate_context_artifacts.py).
  • I ran docs lint checks (python3 scripts/docs_lint.py).

Docs Impact

  • No docs impact
  • Docs impact present in this PR

If no docs impact, explain why:

This change is a service-layer refactor and guardrail tightening (typing/validation/push helper contract) without changing external API request/response semantics or runbook procedures.

Test Plan

  • Unit tests
  • Integration/manual test

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Add actor-aware git identities with HTTPS credential override Address review feedback on actor handling and push semantics Mar 24, 2026
Copilot AI requested a review from yashturkar March 24, 2026 04:57
@yashturkar yashturkar requested a review from yashomdighe March 24, 2026 17:06
@yashturkar

Copy link
Copy Markdown
Owner

@yashomdighe copilot addressed your comments from #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants