Role
This skill owns session runtime behavior, session isolation, Session Server integration, and SSE execution patterns under WLS. It keeps long-lived streaming and session-sensitive flows safe for cooperative runtime execution.
When To Use
- Use for Session Server issues, session isolation, login state, SSE controllers, EventSource flows, and long-running stream loops.
- Use for keywords such as session, login state, SessionFactory, SSE, EventSource,
text/event-stream, andSseWriter. - Use when runtime behavior depends on request isolation or cooperative long-lived streaming.
Source Material
AI-ENTRY.mdCLAUDE.mddev/ai/skills/session-development/SKILL.mddev/ai/skills/sse-streaming/SKILL.mddev/ai/skills/weline-framework-runtime/SKILL.mddev/ai/skills/runtime-and-process/SKILL.md
Responsibilities
- Keep session access inside framework session abstractions instead of raw global state.
- Preserve area-based session isolation and login separation.
- Implement SSE loops that cooperate with WLS workers instead of blocking them.
- Close streaming responses correctly and safely under WLS.
Workflow
- Confirm whether the issue is session isolation, session persistence, or SSE runtime behavior.
- Read the session and SSE source guidance before touching code.
- Update session access through the proper factory or business-session abstractions.
- For SSE, implement or repair the stream using
SseWriterand cooperative delay patterns. - Ensure the stream ends with explicit completion or close behavior.
- Validate on a dedicated WLS test instance with a unique name and non-production port.
- Stop the test instance after verification and report runtime evidence.
Weline Rules
- Do not use default WLS port
9501for AI testing. - Always start a dedicated WLS test instance on port
9502+. - Always use a unique AI test instance name.
- Stop the AI test instance after automated validation.
- If user manual acceptance is required, keep only the dedicated
ai-test-*instance running and hand off URL/name/port/status/stop command until the user confirms acceptance. - Do not pollute global state.
- Do not use global variables for request, user, session, stream, or login state;
$_SERVERis only allowed in Fiber/WLS request context assembly, and all other code must useWelineEnv,w_env*, request objects, or explicitContext; context assembly must pass explicit Context, request, session, or service abstractions onward. - Do not use
sleep,die, orexitin WLS runtime-sensitive code. - Do not access raw
$_SESSIONdirectly when framework session abstractions exist.
Inputs Required
- The affected login, session, or SSE flow.
- The owning controller, session class, or streaming endpoint.
- Runtime symptoms, including disconnect or blocking behavior if present.
- Dedicated WLS validation plan and route.
Expected Output
- A session-safe or SSE-safe runtime implementation.
- Evidence from the affected stream or session flow on a dedicated WLS instance.
- Confirmation that the validation instance was stopped after testing.
Validation
- Validate login or session isolation through the real area flow.
- Validate SSE output, heartbeat, and completion behavior on a dedicated WLS instance.
- Confirm cooperative delay patterns are used instead of blocking sleeps.
- Stop the dedicated WLS instance after validation.
Constraints
- Do not embed raw session handling outside framework abstractions.
- Do not treat SSE as a plain JSON endpoint.
- Do not leave streaming loops without explicit completion behavior.
- Do not use blocking delay functions in long-lived stream loops.
Shared Collaboration Contract
This specialist skill must follow 通用工程师-开发规范与代码质量 as the shared engineering and collaboration standard.
Before and during work:
- Know the Weline AI agent roster defined in the shared skill and
dev/ai/agent/README.md. - Keep work inside this specialist's ownership boundary.
- When a problem, blocker, risk, validation failure, or cross-agent issue is found, notify
@Weline-技术主管. - Do not silently expand scope to fix another agent's area.
- Include collaboration status in the final report.