Skip to content

feat(observability): Session 可观测性增强 (Refs #214)#3

Open
aaronwong1989 wants to merge 5 commits into
mainfrom
feat/214-session-observability
Open

feat(observability): Session 可观测性增强 (Refs #214)#3
aaronwong1989 wants to merge 5 commits into
mainfrom
feat/214-session-observability

Conversation

@aaronwong1989
Copy link
Copy Markdown
Owner

No description provided.

…efs hrygo#214)

- Add SessionContext fields to types.Config (Platform, UserID, ChannelID, etc.)
- Add trace ID generator for distributed tracing
- Enhance engine logs with semantic fields (platform, task_type, trace_id)
- Add token recording with platform/task_type dimensions
- Add brain/visual.go for event translation
- Add brain/memory.go for context compression
@aaronwong1989 aaronwong1989 changed the title test feat(observability): Session 可观测性增强 (Refs #214) Mar 8, 2026
探云 Bot added 4 commits March 8, 2026 13:37
- Run goimports on brain/config.go, brain/guard.go, brain/llm/metrics.go
- Format chatapps/slack/builder.go, chatapps/slack/streaming_writer.go
- Fix internal/secrets/provider.go, internal/telemetry/metrics.go
- Format plugins/storage/interface.go and provider/*.go files

Refs hrygo#214
…orage

- Return error when WriteFile fails instead of ignoring the result
- This prevents silent failures during export/backup operations

Refs hrygo#214
aaronwong1989 pushed a commit that referenced this pull request Mar 17, 2026
- Capture immutable values to avoid closure race conditions
- Validate path expansion result (empty string check)
- Add contextual logging for default directory fallback
- Address code review findings #1, #2, #3, #4

Refs hrygo#294
aaronwong1989 added a commit that referenced this pull request Mar 17, 2026
…ygo#298)

* fix(chatapps): cache work directory resolution to reduce overhead (Refs hrygo#294)

* fix(chatapps): improve workdir resolution safety and logging

- Capture immutable values to avoid closure race conditions
- Validate path expansion result (empty string check)
- Add contextual logging for default directory fallback
- Address code review findings #1, #2, #3, #4

Refs hrygo#294

* test(chatapps): add comprehensive tests for workdir resolution

- Extract resolveWorkDir function for testability
- Add unit tests with 100% coverage for resolveWorkDir
- Test scenarios:
  * Empty path (no work_dir configured)
  * Absolute path resolution
  * Tilde expansion (~/path)
  * Partial expansion with unset env vars
  * Relative path handling
  * Race condition safety for closure usage
- Add logging tests for info/warn/debug levels

Resolves hrygo#298 code review feedback - test coverage requirement met

* fix(chatapps): handle os.Setenv/Unsetenv errors in tests (Refs hrygo#298)

- Check return value of os.Setenv to satisfy errcheck linter
- Use t.Cleanup for env var cleanup (best practice)
- Add nolint comment for Unsetenv in cleanup (acceptable)

---------

Co-authored-by: HotPlexBot <noreply@hotplex.dev>
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