-
Notifications
You must be signed in to change notification settings - Fork 76
feat(watch): Enhanced SSE monitoring with detailed event data #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jack-arturo
wants to merge
26
commits into
main
Choose a base branch
from
feat/enhanced-sse-monitoring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
fe9902d
feat(watch): Enhanced SSE monitoring with detailed event data
jack-arturo c30abcd
feat(stream): Add memory.associate event logging
jack-arturo e582888
fix(test): Update enrichment test for dict return type
jack-arturo 03a3eac
feat(stream): Enhanced enrichment events with full context
jack-arturo b16112c
fix: Production bugs - datetime tz, OpenAI tokens, Qdrant race
jack-arturo ad425b5
fix: Correct token parameter for gpt-5 models (max_output_tokens)
jack-arturo 3666301
Merge branch 'main' into feat/enhanced-sse-monitoring
jack-arturo 00012a2
fix: Defensive coding improvements for automem_watch.py
jack-arturo a621599
fix: More defensive coding for automem_watch.py payloads
jack-arturo 05fb0b4
fix: Final defensive coding fixes for automem_watch.py
jack-arturo 9538ab8
refactor(watch): Use Event type alias for all event handler functions
jack-arturo ef85ca0
fix(watch): Defensive unpacking for semantic_neighbors
jack-arturo 5726da8
fix(watch): SSE multi-line parsing, narrow exceptions, auth error han…
jack-arturo f51551e
fix: Log malformed event data in stream_events
jack-arturo 59ea7c4
feat: add Codex auto-fix workflow for CI failures
jack-arturo 63f668a
fix(watch): SSE multi-line parsing, narrow exceptions, auth error han…
jack-arturo 824a774
feat: Add web-based SSE monitor dashboard
jack-arturo ab08c1b
feat(monitor): Add login screen with shared auth (Graph Viewer style)
jack-arturo e766140
fix(monitor): Use api_key param instead of token for SSE auth
jack-arturo 78d002c
feat(monitor): Unified operations dashboard with status cards and inl…
jack-arturo 6d5d8be
feat: Add CORS support for cross-origin clients
jack-arturo 8eabae6
feat(stream): Add optional JSONL event logging with history hydration
jack-arturo 37ad479
docs: Add event logging and streaming endpoints to CLAUDE.md
jack-arturo d1bb238
revert: Remove auto-fix workflow and CI prompt files
jack-arturo 151305e
fix: address CodeRabbit review feedback
jack-arturo 0615de7
fix(monitor): emit store/recall/associate events
jack-arturo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Fix CI Failures - AutoMem/AutoHub | ||
|
|
||
| You are fixing CI failures for the AutoMem/AutoHub project. This is a Python Flask application with: | ||
| - Flask + SSE (Server-Sent Events) | ||
| - FalkorDB (graph database) | ||
| - Qdrant (vector database) | ||
| - Docker/Docker Compose deployment | ||
| - pytest for testing | ||
|
|
||
| ## Your Task | ||
|
|
||
| Analyze the test failures and CodeRabbit comments below, then make the **minimal changes** needed to fix them. | ||
|
|
||
| ## Rules | ||
|
|
||
| 1. **Be surgical** - Only change what's necessary to fix the specific issue | ||
| 2. **Don't refactor** - Resist the urge to "improve" adjacent code | ||
| 3. **Match existing style** - Follow the patterns already in the codebase | ||
| 4. **Preserve API** - Don't change endpoints or response formats unless the fix requires it | ||
| 5. **Keep tests passing** - Your fix should not break other tests | ||
|
|
||
| ## Common Fixes | ||
|
|
||
| - **Import errors**: Check relative imports, ensure modules exist | ||
| - **Type hints**: Add proper typing for function signatures | ||
| - **Async issues**: Ensure proper async/await usage | ||
| - **Database errors**: Check connection handling and query syntax | ||
| - **API errors**: Validate request/response handling | ||
|
|
||
| ## What NOT to Do | ||
|
|
||
| - Don't add new features | ||
| - Don't refactor working code | ||
| - Don't change Docker configuration unless required | ||
| - Don't modify environment variable handling unnecessarily | ||
| - Don't add excessive logging or comments |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| name: Auto-Fix with Codex | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["CI"] | ||
| types: [completed] | ||
| workflow_dispatch: | ||
| inputs: | ||
| prompt: | ||
| description: 'Custom instructions (optional)' | ||
| required: false | ||
| type: string | ||
| branch: | ||
| description: 'Branch to fix (defaults to current)' | ||
| required: false | ||
| type: string | ||
|
|
||
| jobs: | ||
| auto-fix: | ||
| if: | | ||
| github.event_name == 'workflow_dispatch' || | ||
| github.event.workflow_run.conclusion == 'failure' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| actions: read | ||
|
|
||
| steps: | ||
| - name: Determine branch | ||
| id: branch | ||
| run: | | ||
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
| BRANCH="${{ inputs.branch || github.ref_name }}" | ||
| else | ||
| BRANCH="${{ github.event.workflow_run.head_branch }}" | ||
| fi | ||
| echo "branch=$BRANCH" >> $GITHUB_OUTPUT | ||
| echo "🎯 Target branch: $BRANCH" | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ steps.branch.outputs.branch }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Codex Auth | ||
| run: | | ||
| mkdir -p ~/.codex | ||
| echo '${{ secrets.CODEX_AUTH_JSON }}' > ~/.codex/auth.json | ||
|
|
||
| - name: Gather failure context | ||
| id: context | ||
| if: github.event_name == 'workflow_run' | ||
| run: | | ||
| echo "📋 Fetching CI failure logs..." | ||
| gh run view ${{ github.event.workflow_run.id }} --log-failed > /tmp/ci-failures.log 2>&1 || true | ||
|
|
||
| echo "📋 Fetching CodeRabbit comments..." | ||
| PR_NUMBER=$(gh pr list --head "${{ steps.branch.outputs.branch }}" --json number -q '.[0].number' 2>/dev/null || echo "") | ||
| if [ -n "$PR_NUMBER" ]; then | ||
| gh pr view "$PR_NUMBER" --json comments -q '.comments[] | select(.author.login == "coderabbitai") | .body' > /tmp/coderabbit.txt 2>&1 || true | ||
| fi | ||
|
|
||
| echo "# CI Failure Context" > /tmp/context.md | ||
| if [ -s /tmp/ci-failures.log ]; then | ||
| echo "## Test Failures" >> /tmp/context.md | ||
| echo '```' >> /tmp/context.md | ||
| tail -200 /tmp/ci-failures.log >> /tmp/context.md | ||
| echo '```' >> /tmp/context.md | ||
| fi | ||
| if [ -s /tmp/coderabbit.txt ]; then | ||
| echo "## CodeRabbit Comments" >> /tmp/context.md | ||
| cat /tmp/coderabbit.txt >> /tmp/context.md | ||
| fi | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Prepare prompt | ||
| run: | | ||
| if [ -n "${{ inputs.prompt }}" ]; then | ||
| echo "${{ inputs.prompt }}" > /tmp/prompt.md | ||
| elif [ -f ".github/codex/prompts/fix-ci.md" ]; then | ||
| cat .github/codex/prompts/fix-ci.md > /tmp/prompt.md | ||
| else | ||
| cat > /tmp/prompt.md << 'PROMPT' | ||
| Fix the CI failures in this repository. | ||
| Make minimal, surgical changes only. | ||
| PROMPT | ||
| fi | ||
|
|
||
| if [ -f /tmp/context.md ]; then | ||
| echo "" >> /tmp/prompt.md | ||
| echo "---" >> /tmp/prompt.md | ||
| cat /tmp/context.md >> /tmp/prompt.md | ||
| fi | ||
|
|
||
| - name: Run Codex | ||
| uses: openai/codex-action@v1 | ||
| with: | ||
| prompt-file: /tmp/prompt.md | ||
| codex-args: '["--full-auto"]' | ||
| sandbox: workspace-write | ||
| safety-strategy: drop-sudo | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Check for changes | ||
| id: changes | ||
| run: | | ||
| if git diff --quiet; then | ||
| echo "has_changes=false" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "has_changes=true" >> $GITHUB_OUTPUT | ||
| git diff --stat | ||
| fi | ||
|
|
||
| - name: Commit and push | ||
| if: steps.changes.outputs.has_changes == 'true' | ||
| run: | | ||
| git config user.name "codex[bot]" | ||
| git config user.email "codex[bot]@users.noreply.github.com" | ||
| git add . | ||
| git commit -m "fix: auto-fix CI failures [skip ci]" | ||
| git push | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.