Skip to content

fix: skip git requirement for conversation/chat workflows#535

Merged
buger merged 1 commit into
probelabs:mainfrom
buger:fix/skip-git-for-conversation-workflows
Mar 14, 2026
Merged

fix: skip git requirement for conversation/chat workflows#535
buger merged 1 commit into
probelabs:mainfrom
buger:fix/skip-git-for-conversation-workflows

Conversation

@buger
Copy link
Copy Markdown
Contributor

@buger buger commented Mar 14, 2026

Problem

StateMachineExecutionEngine.executeChecks() unconditionally requires a git repository. When isGitRepository is false, it immediately returns an error result with message "Not a git repository or no changes found" — even for chat/assistant workflows that have nothing to do with code review.

This prevents using the Visor SDK (runChecks()) for conversation-based workflows in environments without git, such as:

  • Docker containers (node:*-slim images)
  • Cloud Run / serverless functions
  • CI environments running chat/assistant checks

Reproduction

import { loadConfig, runChecks } from '@probelabs/visor/sdk';

const config = await loadConfig('assistant.yaml');
const result = await runChecks({
  config,
  checks: ['chat'],
  executionContext: {
    conversation: { /* ... */ },
  },
});

// In a non-git environment:
// result.reviewSummary.issues[0].message === "Not a git repository or no changes found"
// The onCheckComplete hook never fires
// The chat workflow never executes

Fix

When an executionContext.conversation is present, the workflow is a chat/assistant interaction — not a code review — and doesn't need git. The fix adds a single condition to skip the git error when a conversation context exists:

const hasConversation = !!(this.executionContext as any)?.conversation;
if (!repositoryInfo.isGitRepository && !hasConversation) {
  return this.createErrorResult(...);
}

The git analysis still runs (providing empty repository info), but execution continues to the check workflows instead of short-circuiting.

Test plan

  • Existing tests pass (no behavior change for code review workflows)
  • runChecks() with a conversation context succeeds in a non-git directory
  • runChecks() without a conversation context still fails in a non-git directory (existing behavior preserved)

🤖 Generated with Claude Code

`executeChecks()` unconditionally requires a git repository, returning an
error result when `isGitRepository` is false. This prevents using the SDK
for chat/assistant workflows (TUI, Telegram, web SDK) in environments
without git (e.g., Docker containers, Cloud Run).

When an `executionContext.conversation` is present, the workflow is a
chat/assistant interaction — not a code review — and doesn't need git.
Skip the git check in this case and proceed with an empty repository info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@buger buger merged commit af35078 into probelabs:main Mar 14, 2026
8 checks passed
buger added a commit to buger/visor that referenced this pull request Mar 15, 2026
The Telegram adapter's buildConversationContext() only included the
current message in the messages array, causing every message to be
processed in isolation without any conversation context. This meant
the LLM couldn't reference previous messages in the chat.

Changes:
- Add in-memory chat history cache to TelegramAdapter (per thread ID)
  with LRU eviction (max 500 chats), TTL (2 hours), and per-chat
  message limit (50 messages)
- buildConversationContext() now returns the full conversation history
  in the messages array, matching the Slack adapter pattern
- Polling runner captures bot responses from engine results and adds
  them to the history, so the LLM sees both user and bot messages
- Inject conversation context into execution context so the engine
  can use it for the git-check bypass (PR probelabs#535)

This brings Telegram conversation handling in line with the Slack
adapter, which already maintains thread history via ThreadCache.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant