fix(oracle): detect workspace state before greeting on no-arg invocation#94
Open
mt-alarcon wants to merge 1 commit into
Open
Conversation
The /oracle no-argument path greeted every user as a new user and led with the onboarding/consulting pitch, even on a fully configured workspace with populated memory and active heartbeats. This contradicts Step 0 of the oracle agent spec, which mandates detecting workspace state before greeting and skipping onboarding when already configured. Branch the no-arg greeting on detected state: - fresh install -> consultant greeting + two onboarding paths (as before) - fully configured -> returning-operator greeting with a state recap - partial -> explain what's configured vs missing, ask to resume Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the Oracle agent's no-argument invocation behavior so it first detects workspace state (fresh, fully configured, partial) and branches the greeting accordingly, avoiding new-user onboarding pitches in configured workspaces. Sequence diagram for oracle no-arg invocation workspace-state detection and greetingsequenceDiagram
actor User
participant Oracle
participant Workspace
User->>Oracle: /oracle
alt [no arguments]
Oracle->>Workspace: read_config_workspace_yaml
Oracle->>Workspace: glob_workspace_dirs
Oracle->>Workspace: check_memory_content
Oracle->>Workspace: check_scheduler_activity
Oracle->>Oracle: classify_workspace_state
alt [fresh install]
Oracle-->>User: consultant_greeting_with_two_paths
else [fully configured]
Oracle-->>User: returning_operator_greeting_with_state_recap
else [partial]
Oracle-->>User: partial_setup_greeting_explain_and_offer_paths
end
else [arguments provided]
Oracle-->>User: handle_argument_flow
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider tightening the workspace-state detection criteria (e.g., how far back counts as 'scheduler has run recently', what constitutes 'memory populated') so the agent has unambiguous, deterministic rules for classifying edge cases between fresh/partial/fully configured states.
- It may help to specify how to handle conflicting signals (e.g., owner/company set but empty memory, or active heartbeats but missing workspace.yaml) so the oracle follows a consistent priority order when deciding between 'fully configured' and 'partial'.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider tightening the workspace-state detection criteria (e.g., how far back counts as 'scheduler has run recently', what constitutes 'memory populated') so the agent has unambiguous, deterministic rules for classifying edge cases between fresh/partial/fully configured states.
- It may help to specify how to handle conflicting signals (e.g., owner/company set but empty memory, or active heartbeats but missing workspace.yaml) so the oracle follows a consistent priority order when deciding between 'fully configured' and 'partial'.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
/oracleno-argument path greets every user as a new user and leads with the onboarding/consulting pitch ("me conta sobre sua empresa e eu monto um plano…"), even on a fully configured workspace with populatedmemory/, active heartbeats, and a filled-inconfig/workspace.yaml.This contradicts Step 0 of the oracle agent spec (
.claude/agents/oracle.md), which mandates:The command file never told the agent to run Step 0 on the no-arg path, so the generic new-user greeting won regardless of actual state.
Fix
Branch the no-arg greeting on detected workspace state:
No behavior change for genuinely new installs; configured workspaces stop getting an onboarding pitch they don't need.
Scope
Single-file, prompt-only change to
.claude/commands/oracle.md. No code, no schema, no dependencies.🤖 Generated with Claude Code
Summary by Sourcery
Adjust Oracle's no-argument invocation behavior to detect workspace state before greeting and tailor the opening flow accordingly.
Enhancements: